In your InitInstance() method in the C***App class find this piece of code and add the indicated line:
[...]
CCommandLineInfo cmdInfo;
\\add the following line
cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing;
ParseCommandLine(cmdInfo);
[...]
That's all (BTW, I found it in the MSDN...
Hi,
I don't know this VB function, but I know how to prevent you run your application many times.
Actually I have to say that this piece of code is not mine, but unfortunally I don't remember where a found it.
In your C***App class add a member function, for example
BOOL...
I had this problem too. My fault was to keep the system date before the files creation date (in order to use some expired library :-) :-) :-) :-) ). Adjusting that and a Rebuild All operation fixed the problem (And after paying for the library registration obviously :-) )
But I don't know if...
Thanks!
The idea to use GetComputerName or GetUserName (better both ;-) ) is very good. It's simple and quite powerful. That's perfect for my task.
Thanks a lot for your quick answer
Hi,
I almost finished a project and I have to pass the compiled filed to another person that must test it. I have full access to his computer and I'd like to make some trick that prevent the execution of this program under other machines. I don't wanna waste a lot of time, I don't need something...
Hi,
I have what it seems to be a very simple problem but that it's driving me crazy.
I made a SDI application (VC++ 6). When I created it the print preview was working fine, but now it doesn't.
The error seems to be in the GetDocument method, but I can't understand why, since I didn't change...
I took a look at the MSDN Library and I found the following code. I tried it and it seems to work.
In your CDoc class create a function GetDoc()
CMyDoc * CMyDoc::GetDoc()
{
CMDIChildWnd * pChild =
((CMDIFrameWnd*)(AfxGetApp()->m_pMainWnd))->MDIGetActive();
if (...
I made a SDI application using a generic name. Now this program growned up and I need to change its name (redoing all the project would take too much time), because I don't wanna see the title bar reading "namefile.ext - OldName" every time I open/save a file. I know I can change this...
The semicolon must be put after cout line, but not at the end of the "if" statement.
About the best way to find minimum e maximum values of three number, your method is straightforward, then perfect. A more general method (for more then just three elements) may be this:
int...
You must enclose your if conditions in a bracket and don't use semicolon, otherwise the semicolon itself will be considered as the instruction to execute if the statement is true.
Then, your instruction will became
if (( iNum1 < iNum2 ) && ( iNum1 < iNum3 ))
{
cout<<"Smallest is...
If I make a new toolbar, clamping it at the top of the window, it is put in a new line, even if it can fit on the above one. Is there a way (I know you know it ;-) ) to avoid this?
Thanks
...just like drawing a bitmap using BitBlt() function.
That's the way!
Here's an example. It's quite simple, I guess there's no need to further explanations.
CClientDC clientDC(this);
CDC memDC;
CBitmap memBitmap;
CRect rect;
memDC.CreateCompatibleDC(&clientDC);
GetClientRect(&rect)...
OnLButtonDown function has already its own parameter named 'nFlag'. Thus, if you use the WM_LBUTTONDOWN message just check this Flag to see if you are pressing the shift key.
if (nFlags & MK_SHIFT) {
DoWhateverYouHaveToDo();
}
In practice, it's what TGM already told you, but its method works...
I usually override OnMove instead(and, in case, onSize, using the same code) so, if you move the window (or resize it) nothing changes. Remember to release the cursor using ClipCursor(NULL), for example in your dialog's OnDestroy().
Thanks, you even wrote me the code! Actually I was looking for something more general, bur now I guess your method is the only one I can use.Maybe I have to 'defrag my mind' and simplify everything.
Thank MinnisotaFreezing
I got a problem, but I don't know if it is possible to resolve it...
I have a string, let's say
CString str = "4*2.5";
and I'd like to do a thing like this
double result = unknownFunction(str);
obtaining result = 10;
Is it possible to do it?
(Obviously, if so, how? :o) )
Don't...
Hi everybody!
I made a SDI application and I'd like to change its language. How can I do it? It's simple for text in the String Table, but where I have to look to change, for example, standard messageboxes?
Thanks
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.