|
can you give us the intent of the code?
i.e. what do you WANT it to do?
bryce
|
|
|
|
|
thank you for your enlisting,although i have figured out it,but i will give more explanation to the problem next time
|
|
|
|
|
Hi everyone,
I am beginner and I don't know the difference between
cout<
|
|
|
|
|
endl means "move the cursor to the next line", no matter where it appears. So your first line of code moves the cursor to the next line. Your second line of code prints "statement" and then moves the cursor to the next line.
|
|
|
|
|
IIRC endl will append a \n caracter to the line and call the flush function. In other words,
cout << "statement" << endl;
is the same as writing:
cout << "statement\n";
cout.flush();
|
|
|
|
|
thanks for your thoughts...
|
|
|
|
|
dalmar mahamoud wrote: cout<<endl; and=""
cout="" <<"statement"<<="" endl;.<="" blockquote="">
there is tnohing diffrent except First Line is giving Line Break and Second one is giving line break after writing "statement" on screen!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief
|
|
|
|
|
Can I find what kind of controls the other window has if I have the value to it's handle?
|
|
|
|
|
Use the GetClassName() function to find the class of a control.That is if it is a edit control it returns "Edit"( WC_EDIT ).
|
|
|
|
|
CWnd::FromHandle
static CWnd* PASCAL FromHandle( HWND hWnd );
gives you a Cwnd pointer to the window in question ...from there i;d be looking at the help files for information about how to get pointers to child windows
bryce
|
|
|
|
|
bryce wrote: how to get pointers to child windows
EnumChildWindow()...?
|
|
|
|
|
bryce wrote: gives you a Cwnd pointer to the window in question ...from there i;d be looking at the help files for information about how to get pointers to child windows
FindWindowEx
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief
|
|
|
|
|
Hello all. I have a DLL that is used among two different applications. So far, it was nice. However, they recently decided that the application should use some directory (for reading config files) if it is called from program "x" or other directory if the program is "y".
Now I know that with some registry flag or file (no multithread support is required) this will work. Yet I don't want to create extra files and registry keys and such.
So I was wondering, is there any way I can know which program is calling the DLL's functions? I was thinking something about some of the parameters of DllMain, but since I'm with MFC this time, I don't have DllMain, but CWinApp::InitInstance.
Any suggestion will be really appreciated.
Regards,
FG.
|
|
|
|
|
GetModuleFileName() will return the name of the executable( the HMODULE should be passed as NULL ). So I think with this you can distinguish the exe.
|
|
|
|
|
Yep, worked perfectly, thank you.
Might add that I thought on that function, but also thought that it would return me the name of the DLL...
|
|
|
|
|
hi, i wrote a multithread MFC dialog,
in my CMYTESTDlg class,i declared a static thread function and several static variable like param1.
the thread funtion uses the static variable, but i got error lke this during linking:unresolved external symbol "public: static long CMyTestDlg::param1"
(if i don't use static variable, the error will be something like illegal refernce)
what's gonig on? and how do i fix the error?
|
|
|
|
|
You have to initialize your static variables.
<br />
long CmyTestDlg::param1 = 0;<br />
|
|
|
|
|
i think i did initialized the variables,
here is my thread function
UINT __cdecl ThreadFunc(LPVOID pParam){//AfxBeginThread(ThreadFunc, this);
CMyTestDlg* me=(CMyTestDlg*)pParam;
me->param1 = 0;
....
}
|
|
|
|
|
You need to define the static variable, as Cyrilix showed (outside of the class declaration).
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
alberthyc wrote: me->param1 = 0;
if param1 is static variable you should call it like this
CMyTestDlg::param1 not me->param1. as static variable not linked with object
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief
|
|
|
|
|
Hi,
I got an activex control which works fine in debug build but the same is showing 'memory not enough' problem in release mode.
Please advice.
Thanks in advance.
Regards,
John.
|
|
|
|
|
Probably start with all the compiler and linker settings and their differences.
You can also have debug info attached in a release build and run it in the debugger.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Probably start with all the compiler and linker settings and their differences.
<<
I gave all the setting of the debug mode to the release mode. Still the bug
persists.
>>
You can also have debug info attached in a release build and run it in the debugger.
<<
If i tick on the 'Generate debug info' in the Project>Settings>Link for the release setting i cant set up a break point. It will get disabled.
>>
Thanks for your attention.
Kind regards,
John.
|
|
|
|
|
Do you have debugging info turned on for the compiler as well?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|