|
One other thing to check - file paths. Do you open any files, and do you depend on their existence in certain locations? If you go to Project Settings, Debug tab, is there anything in the "Working Directory" path? Try changing that to point to the directory where the EXE is and see if you get the same crash as when running it from explorer.
I think by default, the "working directory" when running under Visual is the directory where the .dsp is.
If you aren't looking for or opening any files, though, this shouldn't matter.
No generalization is 100% true.
Not even this one.
|
|
|
|
|
Thanks, this is worth checking, but I have already seen other instances where expected files were not present and the file open/error handling routines caught them. I wouldn't think this would give me an abnormal termination error, but if I can narrow down more precisely where the error occurs, I may find that it turns out be something simple like this.
Thanks,
Dave
"You can say that again." -- Dept. of Redundancy Dept.
|
|
|
|
|
I need to make my own file dialog because i want features that are not in the standard one. Does anyone know how to make a control that shows all of the files like the one in the standard file open/save dialog.
==================================================
When Your Mind Wonders...Where Does It Go???
|
|
|
|
|
Have you thought about subclassing the standard file dialog?
You could use the common file dialog, give it your own DialogProc, and add the new controls or features that you are interested in.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
sounds like a good idea, but there is only one problem, i have no idea what so ever about subclassing dialogs. Ill look up on it though, thanks.
==================================================
When Your Mind Wonders...Where Does It Go???
|
|
|
|
|
You can add controls to the standard dialog. Look up OFNHookProc in MSDN.
Like it or not, I'm right.
|
|
|
|
|
I had a look at that article, and to be honest i have little to none knowledge of c++ so I did not understand how i would use that function in context.
==================================================
When Your Mind Wonders...Where Does It Go???
|
|
|
|
|
If you use MFC you can enumerate all files like this:
CFileFind cFind;
CString cstrFileName, cstrTempFile;
cstrFileName = "C:\\*.*";
if (cFind.FindFile(cstrFileName))
{
BOOL bFound = TRUE;
while (bFound)
{
bFound = cFind.FindNextFile();
if (cFind.IsDots())
continue;
else
{
cstrTempFile = cFind.GetFilePath();
}
}
}
cFind.Close();
Look up FindFirstFile for the API equivalent.
Like it or not, I'm right.
|
|
|
|
|
See this article.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Is there a way to programically disable/enable the close button on a dialog box (I mean the little "X" in the top right corner)? I don't want to over ride the OnClose() function. I want to gray out the "X" or enable the "X".
Any ideas?
|
|
|
|
|
Call GetSystemMenu on your window.
Then you can call DeleteMenu on the close menu item with the SC_CLOSE ID.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Thanks,
WOrked like a charm.
|
|
|
|
|
Your welcome!
BTW, you may have to remove the separator on the sytem menu as well if that bothers you to have and empty section after the separator.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Hi all,
Is there any way I can intercept GDI calls, i.e. for accessibility or computer-based training apps? I couldn't find any consistent documentation on doing such a thing.
Thanks!
|
|
|
|
|
you can hook those calls, but this is no little task. See for instance Ivo Ivanov's API hooking revealed.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
What do you plan on doing with the API calls once you get them? Because you may be able to do something simpler like replacing the DC that these GDI calls draw on in order to get the image. If you plan on changing the behaviour of the GDI call then you will need to do the API hooking that was mentioned in the other response to you question.
You may want to look at Matt Petriek's book, I believe it is called Windows 95 System Programming Secrets, it contains a sample program that you could probably lift to get the API hooking functionality.
Good Luck.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
1 icon containing 2 sizes: 16x16 and 32x32.
When we use the SetIcon(hIcon) function on a control (for example CButton), it will always use the large icon. How can I force it to use the small one?
I've noticed a function SetIcon(hIcon,bSmall) (or something similar), where bSmall represents the size of the icon as a boolean. This works for the CDialog class, but not for the CButton class
I want to use the standard CButton class rather than any custom class.
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
Have you tried loading the 16x16 icon instead of the 32x32?
Take a look at the ::LoadImage routine. It allows you to specify the size of the resource you want to load. By default, the LoadIcon routine will only load the 32x32 icon image. Or to be more specific, the SM_CXICON x SM_CYICON image.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
I'm not sure what you're trying to say. I don't see a LoadImage() function, only LoadIcon(), LoadCursor(), LoadOEMIcon(), ...
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
(HICON)LoadImage(hInstance, MAKEINTRESOURCE(IDI_YOURICON), IMAGE_ICON, 16, 16, 0);
Like it or not, I'm right.
|
|
|
|
|
Ok...
Is DestroyIcon() needed at the end? (It isn't if you use LoadIcon)
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
You don’t need to destroy anything as you haven’t created anything. You have only loaded the icon from an embedded resource.
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
And where should I put DestroyIcon(HICON)? If I put it in OnDestroy(), the resources are not freed from memory
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
This is what I have done that works well for me.. in your OnInitialUpdate() you have the...
SetIcon(m_hIcon, TRUE);
SetIcon(m_hIcon, FALSE);
Change the // set small icon to "TRUE" like this...
SetIcon(m_hIcon, TRUE);
SetIcon(m_hIcon, TRUE);
|
|
|
|
|
Hi all
i've encountered some problem.
1) It gives me some error when i attempt to create a group object from class Group. This is my Constructor:
Group(CString &t1, CString &t2, CString &t3, CString &t4)
and this is how i used it
Group groupA(CString("France"), CString("Uruguay"), CString
("Denmark"),CString("Senegal");
but i got this error unexpected class CString.
I have tried passing LPCTSTR char pointer instead of CString but it
still produces the same error.
Any help is appreciated.
|
|
|
|