|
PostQuitMessage definitely works when called from the constructor of CMainFrame .
You can check the exit code using the function GetExitCodeProcess .
This can be used when invoking the application using the CreateProcess API, where it first waits for the program to terminate using the WaitForSingleObject function.
Otherwise you can get the exit code by checking the ERRORLEVEL variable when run from the command prompt or a batch file.
Here is more information on this - ERRORLEVEL is not %ERRORLEVEL%[^]
«_Superman_»
I love work. It gives me something to do between weekends.
Microsoft MVP (Visual C++) (October 2009 - September 2013) Polymorphism in C
|
|
|
|
|
Thanks for the reply.
Yes indeed it works but since i am using codejock's library i get assertion errors and the app is not closing as it would expected but it stays alive doing nothing (no mouse or keyboard response).
Regards,
sdancer75
|
|
|
|
|
how to create checkpoint for svn if want to make new changes in source files?
|
|
|
|
|
Every commit done in SVN automatically assigns a version number to it.
You can, at any time, look at the SVN log and rollback your working copy to the desired version.
You can also tag a particular version so that you give it a human readable or easily recognizable name.
Here you can use the tag name for the rollback.
You can get detailed log information by looking at the revision graph.
«_Superman_»
I love work. It gives me something to do between weekends.
Microsoft MVP (Visual C++) (October 2009 - September 2013) Polymorphism in C
|
|
|
|
|
Every time you check in you essentially create a checkpoint, hence you can undo/track any changes in source. Usually your main source is kept in a folder labeled as a "trunk", projects are kept in a "branch" until they're finished and ready to be re-integrated into the trunk, and you can create a "tag" of any major event (such as software releases).
|
|
|
|
|
Hello,
I have some CUDA code in .cu file that I add to my solution (MFC project in VS 2008) as a source file and it all works fine. Now I would like to access the same functions that I defined in .cu file in my application via a DLL equivalent of that .cu file so that I can keep the soruce code away from users.
Could someone help me out with this? I already tried on nvidia forums, but didn't get any reply.
thanks in advance.
PKNT
|
|
|
|
|
|
I am aware of writing DLLs in C++ and I have written many before. I started out in the same way and stumbled upon errors specific to cuda header files that are included in the project.
Specifically syntax missing error for the lines
texture<Complex, 2, cudaReadModeElementType> texDataIn;
texture<Complex, 2, cudaReadModeElementType> texDataMid;
texture<Complex, 2, cudaReadModeElementType> texDataOut;
PKNT
|
|
|
|
|
|
For all those 3 lines, the error log shows
1>error C2143: syntax error : missing ';' before '<'
1>error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>error C2143: syntax error : missing ';' before '<'
1>error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>error C2086: 'int texture' : redefinition
1>see declaration of 'texture'
1>error C2143: syntax error : missing ';' before '<'
1>error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>error C2086: 'int texture' : redefinition
1>see declaration of 'texture'
thanks
PKNT
|
|
|
|
|
That first error essentially says that the texture<> template is undefined. Make sure you have the appropriate header included.
|
|
|
|
|
Hello there,
I have a CDHtmlDialog app in which am trying to add a CSS media query in the HTML file as shown below, but it doesn't work.
@media(max-width:20em) {
table, thead, tbody, tfoot, th, td, tr { display:block; }
tr + tr { margin-top:1em; }
}
The same CSS works fine if i open in a browser like IE, FireFox, Chrome. But inside the CDHtmlDialog app this doesn't work.
I am using Visual Studio 2012 for development and have IE 11 installed in my machine.
Any ideas?
THanks in advance.
|
|
|
|
|
I know I already addressed this in my answer to one of your previous questions[^], but let me repeat just to make sure since you did not say if that fixed your problem.
The version of IE used in CDHtmlDialog depends on your OS and what version of IE you have installed, but that does not mean it defaults to using IE11 compatibility even if you have IE11 installed.
Make sure your HTML file has <!DOCTYPE html> at the beginning and you might have to have <meta http-equiv="X-UA-Compatible" content="IE=edge"> in your document as well.
You might have to take to the registry to get the browser control to behave correctly. Check out this on SO[^], this on MSDN[^] and check your settings by connecting to this[^]
Soren Madsen
"When you don't know what you're doing it's best to do it quickly" - Jase #DuckDynasty
|
|
|
|
|
Did the trick for me!
Thanks SoMad!
|
|
|
|
|
Great!
"When you don't know what you're doing it's best to do it quickly" - Jase #DuckDynasty
|
|
|
|
|
HI, in a MFC program.
I use CDC* pDC = GetDC(); get a CDC pointer of screen.
but I need to create a new font, so I use:
HDC hdc = pDC->GetSateHdc();
my question is, after I done the function, I use:
Release(pDC), released the CDC object.
then do I need to release hdc handle? like Release(hdc)?
modified 21-Feb-14 15:43pm.
|
|
|
|
|
Nope, shouldn't have to do that. That should already be handled when you release the object.
|
|
|
|
|
I would like to dynamically create menu items attached to a submenu of a submenu.
I can get access to the first level of submenu using GetSubMenu, but cannot get to the second level probably because this function returns CTempMenu. Both submenus are pop-up, but I must be must be missing something else here.
Here is my test code snippet which asserts on pSubSubMenu
CMenu *pSubMenu,*pSubSubMenu;
int iCount = pMenu->GetMenuItemCount();
if (pMenu != NULL && pMenu->GetMenuItemCount() > 0)
{
pSubMenu = pMenu->GetSubMenu(2);
ASSERT(pSubMenu);
}
pSubSubMenu = pSubMenu->GetSubMenu(0);
ASSERT( pSubSubMenu);
Any suggestions will be as always appreciated.
Cheers
Vaclav
<pre lang="text">Can I get submenu of a submenu? ( MFC VC 6.0)
I woul like to dynamically create menu items attached to a submenu of a submenu.
I can get access to first level of submenu using GetSubMenu, but cannot get to the second level probably because this function returns CTempMenu. Both submenus are pop-up, but I must be must be missing something else here.
Here is the code snippet which asserts on pSubSubMenu
CMenu *pSubMenu,*pSubSubMenu;
int iCount = pMenu->GetMenuItemCount();
if (pMenu != NULL && pMenu->GetMenuItemCount() > 0)
{
pSubMenu = pMenu->GetSubMenu(2);
ASSERT(pSubMenu);
}
pSubSubMenu = pSubMenu->GetSubMenu(0);
ASSERT( pSubSubMenu);
Any suggestions will be as always appreciated.
Cheers
Vaclav
|
|
|
|
|
Hi,
To avoid the temporary handle and CTempMenu you can use CMenu::GetSafeHmenu[^] to get a permanent handle. You would then call CMenu::Attach[^] to attach to a CMenu object and then manipulate the menu.
Best Wishes,
-David Delaune
|
|
|
|
|
I think you can try use GetSubMenu() twice to get submenu of a submenu.
|
|
|
|
|
Thanks guys,
there is a minor "problem" with building / attaching permanent handle - it is already attached to window as m_hMenu data memeber of CMenu. I tryed to use it with same results - the second level always returns NULL. The strange part is that docs saiz if the popup submenu does not exist it will create it. But even than it returns NULL.
I would like to use that handle to get to next submenu, but I feel I need to look into what message(s) are being posted when the mouse goes over the menu items and try to process those instead.
I also forgot to say that I am using OnInitMenu in main frame which runs only once.
|
|
|
|
|
Here is what works, still not sure why I could not use m_hMenu similar way.
Basically a copy of MFC code.
HMENU hMenu = pSubMenu->GetSafeHmenu();
pSubSubMenu = pSubMenu->FromHandle(hMenu)->GetSubMenu(2);
ASSERT(pSubSubMenu);
Thanks for all the help I got, you guys are great!
Cheers Vaclav
|
|
|
|
|
1. Create a structure Fraction (numerator, denominator). Accept details of n fraction and write a menu driven program to perform the following operations. Write separate functions for different options. Use dynamic memory allocation.
i) Display the largest Fraction.
ii) Display the smallest Fraction.
iii) Sort Fraction.
iv) Display all.
Note: While accepting fractions, store the fractions in the reduced form.
|
|
|
|
|
Please do not post your homework assignments here; no one is going to write it for you.
|
|
|
|
|
Looks interesting. Good luck with your homework.
Veni, vidi, vici.
|
|
|
|