|
if (!::IsWindow(*phWnd)) {
*phWnd = ::WindowFromDC(hDC);
}
|
|
|
|
|
|
it was passed to this function from another function.
When i am debugging i am getting the handle. When i am executing i am getting error
|
|
|
|
|
I think problem is of hDC,are you sure its valid?
|
|
|
|
|
|
But did you see MSDN
"If no window is associated with the specified DC, the return value is NULL." and I guess it returns a null hwnd and when you want to use of this handle you get an error.
|
|
|
|
|
Its a valid DC.. Initially I am retreiving DC by using window handle and at later pointer .. I pass only DC to a function and then now I want to retreive window handle using this DC. This call is getting failed.
|
|
|
|
|
|
Is there any way to find VC++ redistributables version installed on a system, Does there any "registry key" or win32 API exists to find that?
Thanks,
Mushq
|
|
|
|
|
|
Hamid. wrote: See here[^].
Please check who started that thread, it's me and I haven't got any suitable answer from that, so have asked it here.
Regards,
Mushq
|
|
|
|
|
I saw your name on the codeguru but I forgot to see your name on the MSDN.
|
|
|
|
|
Regards,
Mushq
|
|
|
|
|
Hi,
I am using VS 2008, VC++, MFC.
I am trying to draw the groupbox with a custom color and also choose my own color for the text displayed.
I would greatly appreciate if you could help me with this.
Thanks.
-A
|
|
|
|
|
See WM_CTLCOLOR* on the MSDN.
|
|
|
|
|
Hello dear friends,
I am creating the toolbar in VC 6.0.
I want to show the menu when the button of the toolbar will be clicked.
But when I use the LoadMenu for loading the menu from the resource i get
0 as the return value and GetLastError() returns the description
"The specified resource type can not be found in the image file."
I really don't understand the problem.The code snippest is as shown below.
void CMFToolbar::PopupFileMenu()<br />
{<br />
<br />
try<br />
{<br />
CMenu mnu;<br />
CMenu *submnu;<br />
RECT rectSubmitButton;<br />
if(!GetItemRect(CommandToIndex(IDB_FILE),&rectSubmitButton))<br />
{MessageBox("Fail1",_T("QpOffice Toolbar"),MB_ICONERROR); return;}<br />
if(!MapWindowPoints(HWND_DESKTOP,(POINT*)&rectSubmitButton,2))<br />
{MessageBox("Fail2",_T("QpOffice Toolbar"),MB_ICONERROR); return;}<br />
if(mnu.LoadMenu(IDR_FILE_MENU))<br />
{<br />
MessageBox("1",_T("QpOffice Toolbar"),MB_ICONERROR);<br />
}<br />
else<br />
{<br />
char buf[MAX_PATH];<br />
strcpy(buf,ErrorDescription(GetLastError()));<br />
MessageBox(buf);<br />
}<br />
}<br />
catch(...)<br />
{<br />
MessageBox("Exception",_T("QpOffice Toolbar"),MB_ICONERROR);<br />
}
Thanks in advance to all of you.
ritz1234
|
|
|
|
|
Is the menu resource in the module you're calling LoadMenu() from?
If so, is its id == IDR_FILE_MENU? If so, is it the same IDR_FILE_MENU
you use in the code?
Is this code in a DLL or an EXE?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks for the reply Mark
1)The LoadMenu and the menu resource are in the same module.
2)Its id is IDR_FILE_MENU
3)It a DLL.
I've got one other solution in which I am constructing the menu from the scratch instead of using the menu defined in the resource script.
It is working.
One question in this approach is how to add the things like the menuitem which belongs to the cursor should have foreground color differes from the background color.
ritz1234
|
|
|
|
|
So the Menu resource resides in Dll and you call load menu in Dll exported function and you use VS 6.0.
in the exported DLL function, call in the beginning.
AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
[AFX_MANAGE_STATE^]
|
|
|
|
|
Thanks for handling all my answers this morning
Cheers,
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks mark
|
|
|
|
|
Hi,
I m' trying to integrate one of my sub-module applictaion(SDI)
into my major module..In such a case i m' getting the following
build error:
CVTRES : fatal error CVT1100: duplicate resource -- type:DIALOG,
name:130, language:0x0409
.\Debug\FINEART_V1.res : fatal error LNK1123: failure during
conversion to COFF: file invalid or corrupt
Error executing link.exe.
Kindly suggest me y it happens wats' the way of solvin tis error..
Gita
|
|
|
|
|
You've got duplicate ids in your .rc file.
Steve
|
|
|
|
|
Ya steve,
i got it k an provided with new ids..
thank u..
Gita
|
|
|
|
|
Hi,
I developing an application which hooks a Common dialog. i used CDM_GETFILEPATH to get the full path from Save dialog. But when there is not file extension is specified with the file name, the CDM_GETFILEPATH return's the full file path without any file extension.i thought If an extension is not given with the file name the default extension is concated with the file name. But this is not happing and CDM_GETFILEPATH give like this "C:\MyFolder\new" and not full path "C:\MyFolder\new.txt". Why?? . And is there any way to get the default file extension from a Common Dilaog using any Mesages and if so Which is that message?.
thanks
Nitheesh
|
|
|
|