Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: Triac
  • Order by date
  1. Triac

    New document when application is started

    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...
  2. Triac

    starting an application

    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...
  3. Triac

    Non-incremental Builds.... So slow....

    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...
  4. Triac

    How to execute a .exe in only one machine

    Hi victorv, the second post was not mine. BTW, thanks to pankajkumer too.
  5. Triac

    How to execute a .exe in only one machine

    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
  6. Triac

    How to execute a .exe in only one machine

    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...
  7. Triac

    Print Preview problem

    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...
  8. Triac

    MFC: CDocument* GetActiveDocument()

    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 (...
  9. Triac

    Chancing the title bar text...forever

    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...
  10. Triac

    Simple IF Statement

    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...
  11. Triac

    Simple IF Statement

    OOoops, meanwhile I was responding Zyrenthian dit it before me, sorry. Consider it as a resume :-)
  12. Triac

    Simple IF Statement

    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<<&quot;Smallest is...
  13. Triac

    How to put two (o more) toolbars in line

    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
  14. Triac

    Drawing shapes and lines

    ...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)...
  15. Triac

    Shift Button and click???

    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...
  16. Triac

    Dialog boxes

    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().
  17. Triac

    Convert an expression to its value

    I like it! I guess that's the right way. s-) Thanks to you both!
  18. Triac

    Convert an expression to its value

    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
  19. Triac

    Convert an expression to its value

    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 = &quot;4*2.5&quot;; 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...
  20. Triac

    Change language

    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

Part and Inventory Search

Back
Top