|
Hi,
In my app I need to set selection for files in windows explorer view. I just need to bring that blue background like the one we see when we click an item inside a folder. Please tell me how to do this using VC++.
Thanks,
J
|
|
|
|
|
Hello.
I'm trying to capture a screen shot while in full-screen mode in a game. The game can use either Direct3D (directx) or OpenGL as its displaying driver. while trying to get the screenshot in both drivers (in fullscrteen mode) the image is black or unuseful. I'm aware that the problem is known, but I don't have any solution for it.
I'm searching for the solution to this problem in C\C++ (though other languages will do aswell). I've tried to use GDI+, use a robot for the printscreen (btw it doesn't work even without the robot) and a bit more options, and still no idea how to get a screenshot of the fullscreen game in win vista\7.
I'd appreciate any help.
Sincerely,
Me.
|
|
|
|
|
Has anyone figured out the problem atleast? has its name or any info about it?
It would really help me alot, thanks.
|
|
|
|
|
I use satellite DLL for localization purposes in my application. And loading the dll with AfxSetResourceHandle. This works fine for all of my dialogs that doesn't use a custom control.
For those with custom control the constructor is called but not OnInitDialog or DoDataExchange
And DoModal returns -1
Any suggestion?
Thanks.
|
|
|
|
|
The system probably cannot create the custom control on your dialog. The custom control has to be registered before you can try to create a dialog which contains it, otherwise when the system gets to the custom control (when loading the resource and creating the dialog from it) and checks its class it won't find it among the known control/window classes and thus fail to create it which leads to the whole dialog creation process' fail.
Also check if you specified the right window class name in the resource editor for your custom control, if you forgot to do it or if you made a typo then you get the same result as above.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Ok, checked the window class name and it's not misspelled
But how do I check if my custom control is registered, I just know that if I place it "normal" resourcefile - not in the satellite file everything works fine
|
|
|
|
|
So you say that if you have the same custom control in a resource inside a DLL, and you load the resource from the DLL and try to create the dialog, it fails, but if you have the very same resource in the exe, not in an external DLL, without otherwise changing anything on your code, it works? You said other dialogs which do not have the custom control on them work fine, you load these from the DLL too?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Yes that is correct and other dialogs in the satellite DLL works fine as long isn't any custom controls in it. I have also tried with an other custom control and I got the same result.
|
|
|
|
|
Call GetLastError[^] after your DoModal returned (with -1) and see the System Error codes[^]. Which error does it report? Also another question, how/where do you register your custom control?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
void CMultiLangApp::OnAppAbout()<br />
{<br />
CAboutDlg aboutDlg;<br />
aboutDlg.DoModal();
}<br />
<br />
<br />
INT_PTR CDialog::DoModal()<br />
{<br />
&<br />
&<br />
&<br />
if (CreateDlgIndirect(lpDialogTemplate, CWnd::FromHandle(hWndParent), hInst))
}<br />
<br />
<br />
BOOL CWnd::CreateDlgIndirect(LPCDLGTEMPLATE lpDialogTemplate,<br />
CWnd* pParentWnd, HINSTANCE hInst)<br />
{<br />
&<br />
&<br />
&<br />
hWnd = ::CreateDialogIndirect(hInst, lpDialogTemplate,<br />
pParentWnd->GetSafeHwnd(), AfxDlgProc);<br />
}
The registration of my custom control is done in the the constructor in the control class by calling RegisterWindowClass
|
|
|
|
|
When you register your custom control, using the WNDCLASS[^] or WNDCLASSEX[^] structures, for the hInstance member, do you specify an instance handle of your application? If yes, try giving it the DLL's handle instead and see if it changes anything. You still didn't tell me what GetLAstError() gives you.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
The call to returns NULL and The GetLastError() is 0 after CreateDialogIndirect. as shown below
hWnd = ::CreateDialogIndirect(hInst, lpDialogTemplate, pParentWnd->GetSafeHwnd(), AfxDlgProc);<br />
Well I register my custom control using WNDCLASS and a specify the hInstance, by calling AfxGetInstanceHandle but I don't know how to change it to point to the DLL.
WNDCLASS wndcls;<br />
HINSTANCE hInst = AfxGetInstanceHandle();<br />
<br />
if (!(::GetClassInfo(hInst, BITMAPVIEWER_CLASSNAME, &wndcls)))<br />
{<br />
wndcls.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW;<br />
wndcls.lpfnWndProc = ::DefWindowProc;<br />
wndcls.cbClsExtra = wndcls.cbWndExtra = 0;<br />
wndcls.hInstance = hInst;<br />
wndcls.hIcon = NULL;<br />
wndcls.hCursor = AfxGetApp()->LoadStandardCursor(IDC_ARROW);<br />
wndcls.hbrBackground = (HBRUSH) (COLOR_3DFACE + 1);<br />
wndcls.lpszMenuName = NULL;<br />
wndcls.lpszClassName = BITMAPVIEWER_CLASSNAME;<br />
if (!AfxRegisterClass(&wndcls))<br />
{<br />
AfxThrowResourceException();<br />
return FALSE;<br />
}<br />
}<br />
<br />
return TRUE;
|
|
|
|
|
Try with GetModuleHandle("your_dlls_name.dll"); maybe.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
yes, seams to do the work fine.
But I will do a larger test later to day, so I'm 100% sure it works.
Thanks, this has been bugging by for very long time now
|
|
|
|
|
okey, runned new check and it still works
thanks again
|
|
|
|
|
Glad i could help, but i am not sure how safe this solution is...i am not sure what exactly the hInstance is used for when you register a custom control, i guess it is used by the system to automatically unregister window classes when the module that contains their implementation gets unloaded, if it is so, then as long as your DLL is in memory while your program runs you should not run into any troubles, however i do not know when that DLL will get unloaded, if you still have such custom controls hanging around windows when your DLL is unloaded you probably will run into problems...or i am just being too cautious about it. Anyways, good luck.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Hi to all,
I am a new learner in visual C++ 6.....I knew C++ language, and now i learnt visual studio editor also....just what is enough to debug and run the project...
Now i am having free time and I would like to learn more...I want to be a good vc6 programmer.
Could anyone please suggest some topics(may be related to project design, C++ Concept or anything in VS6 editor that one should know) to me so that I can go through.
Thanks in advance.
-----------------------------
I am a beginner
|
|
|
|
|
your problem is too brief can u explain it little more... what type of programs you want to make in VC++6.
|
|
|
|
|
right now am working on console based application only....
-----------------------------
I am a beginner
|
|
|
|
|
It sounds as though you are interested in making GUI applications. Is that correct?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
i have work in win32 console base application project...also i tried GUI(MFC) of my own....i mean i have very basics of MFC.....so it will be great if u send some topic in console based application...mFC also would be additional knowledge for me
-----------------------------
I am a beginner
|
|
|
|
|
The next step after console applications is using windows for your GUI. There are two approaches you can take: 1. Classic MFC and 2. .NET.
.NET is more modern (and both easier to use and more powerful) but isn't supported in your compiler version (VS 6). If you can get a copy of the Scribble Tutorial (Microsoft), it's a good, simple introduction to MFC.
Effective C++ by Scott Meyers is a good way to extend your C++ skills. Design Patterns by Gamma et al teaches you how to apply the object-oriented features you've learned to solve practical problems.
|
|
|
|
|
Thanks a lot....I will go through all this concepts
-----------------------------
I am a beginner
|
|
|
|
|
|
Thanks you sir, for the precious reply
-----------------------------
I am a beginner
|
|
|
|