|
Thanhnamdo wroteaccept this value from an other Dialog of an other class
If you want to pass value from one dialog to another you can access the parent dialog's variables by
CMain* pMain=(CMain*)GetParent();
Then use this pointer to call member functions / change or alter variables of the first (parent) dialog.
Another way is to pass a pointer from one class to another.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Whats application type if you have two dialog you can use
CMain m_Main=(CMain*)GetParent();and in another application you can use m_Main->(your variable)or(your function)and include header from Main class in another class
|
|
|
|
|
Thank you everybody .I understanded and I'm trying to do it.
|
|
|
|
|
WhiteSky wroteCMain m_Main=(CMain*)GetParent();
A missing *
Should be CMain* m_Main=(CMain*)GetParent();
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
yeah
|
|
|
|
|
I'm a beginer. I use Tree Control in Dialog start and I stored Message TVN_SELCHANGED in a value and I want to accept this value from an other Dialog of an other class .But I don't known how to work .
Plesea help me!
Thanks!
|
|
|
|
|
You want to post this message from another dialog
|
|
|
|
|
I have project..in which i have to add all the Api function and access the data from server and store in my database...
Steps i have followed till now r:
NEW->PROJECT->MFC AppWizard (exe)->Dialog based
In dialog based application :NEXT
PROJECT->ADD TO PROJECT->COMPONENTS AND CONTROLS->GALLARY->REGISTERED ACTIVE-X COMPONENTS->ARIEL API CONTROLS->THEN IN DIALOG BOX I GOT THE INFORMATION ABOUT
1. CLASS NAME AAPI
2. BASE CALSS CWND
3.HEADER FILE AAPI.H
4.IMPIMENTATION FILE AAPI.CPP
IN .CPP FILE ALL THE FUNCTIONS EXAMPLE:
CString CArielAPI::GetServerAddress(LPCTSTR SessionId)
{
CString result;
static BYTE parms[] =VTS_BSTR;
InvokeHelper(0x15, DISPATCH_METHOD, VT_BSTR, (void*)&result, parms, SessionId);
return result;
}
CString CArielAPI::Login(LPCTSTR UserName, LPCTSTR Password, LPCTSTR UserId)
{
//username = wwtest2;
//Password = RD9234;
//Userid = wwtest2;
CString result;
static BYTE parms[] =VTS_BSTR VTS_BSTR VTS_BSTR;
InvokeHelper(0x2, DISPATCH_METHOD, VT_BSTR, (void*)&result, parms,UserName, Password, UserId);
return result;
}
I NEED YOUR SUGGESTION FOR MY PROJECT DO I AM IN THE RIGHT WAY.IS IT OK WORKING WITH DIALOG BASED APPLICATION OR I HAVE TO WORK WITH SOME OTHER ENVIRONMENT...AFTER ACCEPTING DATA DISPLAY THE CURRENT RATE FOR TODAY IN THE TEXT FILE...
cAN U GIVE ME ANY USEFUL SUGGESTION TO PROCEED FURTHER...PLEASE..IF U NEED ANY DETAIL PLS MAIL ME THROUGH THIS FOURM
THANKS IN ADVANCE
|
|
|
|
|
I have:
ULONG *buffer = NULL;
I do:
<br />
buffer = new ULONG[10000];<br />
... create a file, etc.<br />
fprintf( fpwrite, buffer );<br />
...<br />
delete [] buffer;<br />
the problem is:
fprintf(FILE *fptr, const char* cptr).
so, fprintf doesn't take a ULONG pointer as a parameter.
would it be safe for me to:
fprintf( fpwrite, (char *) buffer );
Will I lose data by doing this?
size of char is only 1 byte and size of ULONG is 4 bytes in my system...
Also, how can one limit the size of a file being created and appended?
Thanks.
Kitty5
|
|
|
|
|
Why don't u use fwrite(. It can satisfy all the above requirments.
nave
|
|
|
|
|
would i do:
<br />
FILE *filename;<br />
ULONG *buffer = NULL;<br />
buffer = new ULONG [10000];<br />
...<br />
fwrite(buffer, sizeof(ULONG), 10000, fileName);<br />
...<br />
delete [] buffer;<br />
Thanks.
Kitty5
|
|
|
|
|
yes..
nave
|
|
|
|
|
This sounds like a homework assignment.
We don't do homework
|
|
|
|
|
Actually no... Thanks though.
I've been out of school for quite sometime.
I'm just clearing things up since some of these functions I've never used.
Just because other ppl are more adept at programming doesn't mean the the ones that are teaching themselves to be better at it should be penalized or scoffed at.
thanks for your help though.
Kitty5
-- modified at 8:55 Monday 24th July, 2006
|
|
|
|
|
bob16972 wrote: This sounds like a homework assignment.
Not even remotely.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
kitty5 wrote: fprintf( fpwrite, buffer );
Should be:
fprintf( fpwrite, "%lu", buffer[0]);
fprintf( fpwrite, "%lu", buffer[1]);
...
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi all,
Iam trying to read and write to USB device.
I get an error message
error LNK2001: unresolved external symbol "public: enum FT_STATUS __thiscall CUSBtestDlg::GetStatus(unsigned long *,unsigned long *,unsigned long *)" (?GetStatus@CUSBtestDlg@@QAE?AW4FT_STATUS@@PAK00@Z)
Release/USBtest.exe : fatal error LNK1120: 1 unresolved externals
I tried debugging but in vain.
Can anyone help/ any ideas?
|
|
|
|
|
You need to see why the implementation of CUSBtestDlg::GetStatus(unsigned long *,unsigned long *,unsigned long *) is not in any of your cpp or header files that are included in your project. Have you added all the cpp files in your source folder to the project??
John
|
|
|
|
|
Hi John n Naveen,
Thanks for the response.
In the header file I do,
protected:<br />
typedef FT_STATUS (WINAPI *PtrToGetStatus)(FT_HANDLE, LPDWORD, LPDWORD, LPDWORD);<br />
PtrToGetStatus m_pGetStatus;<br />
FT_STATUS GetStatus(LPDWORD, LPDWORD, LPDWORD);<br />
in the cpp file, I do
int CUSBtestDlg::Buf_Read(void)<br />
{<br />
DWORD dRxBytes;<br />
DWORD dTxBytes;<br />
<br />
DWORD dEventStatus;<br />
<br />
GetStatus(&dRxBytes,&dTxBytes,&dEventStatus);<br />
}
I get the error message that i mentioned before for this.
But I do the FT_STATUS FT_Read() also in the similar way and that works.
Any sugestion.?
-- modified at 23:41 Sunday 23rd July, 2006
|
|
|
|
|
but where is the definition of the funtion GetStatus(..)?
nave
|
|
|
|
|
FT_GetStatus is the FTD2XX_API library funciton.
This is given in the header file ftd2xx.h which is included in the USBtestdlg.h file.
|
|
|
|
|
hoo...So have include the lib file for that api in the project?
nave
|
|
|
|
|
have included the ftd2xx.h file as external dependency in the project. so the drivers installed should take care of linking the functions and reading and writing from the device(USB).
I can use their FT_Read and FT_Write functions without any errors.
Infact I have done the same way for GetStatus too.
|
|
|
|
|
u have to include the lib file for the same.
take menu project->Settings
in the link tab, there will be an edit box called object/library modules. Give the name of the lib file there and rebuild the project.
nave
|
|
|
|
|
FT_Read and FT_Write and FT_GetStatus are all in the same.
I dont know what I should include now.
|
|
|
|