Skip to content
Code Project
CODE PROJECT For Those Who Code

C / C++ / MFC

C, Visual C++ and MFC discussions

This category can be followed from the open social web via the handle c-c-mfc@forum.codeproject.com

111.5k Topics 465.7k Posts
  • Execute Shell Script and Batch Files

    question csharp visual-studio linux tools
    6
    0 Votes
    6 Posts
    0 Views
    L
    Yes, the same as you would do in any application or command shell. However it probably makes more sense to add the batch files into your project directory so they stay with the project. That also allows you to manage them within your source control system as well.
  • Reg. Printing

    com debugging
    2
    0 Votes
    2 Posts
    0 Views
    L
    And do you have a question?
  • 0 Votes
    10 Posts
    0 Views
    M
    I cant get u properly can u please ellaborate...
  • 0 Votes
    3 Posts
    0 Views
    K
    :) :)
  • 0 Votes
    3 Posts
    0 Views
    W
    Correct. The API def for DELETEBUTTON specifies an Index whereas Command Identifier is presumably the idCommand field of TBBUTTON. The API docs are different for each function. Having tested this using the idCommand field of TBUTTON, rather than the Index, it works. Problem solved. Many thanks.
  • 0 Votes
    14 Posts
    0 Views
    L
    It is always best to write and test your code, and then use copy and paste to show exactly what the issue may be.
  • VS2005 Build order problem

    csharp visual-studio help discussion
    3
    0 Votes
    3 Posts
    0 Views
    A
    If build order is important, then specify project dependencies. That should make the build order exactly the same every time. If memory serves right, in a multi-project solution, you can right click on a project and set dependencies within the menus there. When you make one project dependent on the others, Studio will build the dependencies first.
  • 0 Votes
    6 Posts
    0 Views
    A
    There's an order by which exe's look for libraries. It will use the first one it finds, I believe CPallini gave you a link that specifies the search order. You can use tools such as Dependency Walker[^] to see what dll specifically is getting loaded by an exe if you're not sure which one it's loading. It is customary that shared dll's are placed in a location where any program that wants to use it has access to it, of course, this will require admin privilidges for your installer (assuming you place the dll copy in a system folder).
  • 0 Votes
    4 Posts
    1 Views
    J
    You could do your own calibration or have vendor remove dialog box. Failing that, when the calibration utility is started, you could have a thread monitor windows ans when that window pops up, either force it to the foreground or just close it yourself. Where it gets tricky is that only the current active, foreground application can make another application the foreground and despite appearances, who is this application isn't always straightforward. To get around this for one project, I ended up writing the following (The W is the prefix for my personal, but in-the-public-domain, library: bool WSetAppToForeground(LPCWSTR pWindowName) { HWND hWnd = FindWindow(NULL, pWindowName); if (!hWnd) return false; WSetAppToForeground(hWnd); return true; } void WSetAppToForeground(HWND hWnd, bool showMax, bool setFocus) { #ifndef _WIN32_WCE DWORD foregroundProcessId = GetWindowThreadProcessId(::GetForegroundWindow(), NULL); DWORD curThreadId = GetCurrentThreadId(); AttachThreadInput(foregroundProcessId, curThreadId, TRUE); #endif ShowWindow(hWnd, showMax ? SW\_SHOWMAXIMIZED : SW\_SHOW); BringWindowToTop(hWnd); SetActiveWindow(hWnd); SetForegroundWindow(hWnd); if (setFocus) SetFocus(hWnd); #ifndef _WIN32_WCE AttachThreadInput(foregroundProcessId, curThreadId, FALSE); #endif }
  • 0 Votes
    2 Posts
    0 Views
    A
    If you need fast plotting, you're more than likely going to have to get very familiar with the Windows GDI[^]. The toolset is very basic but very fast, works great for high-speed plots.
  • C++ Open the COM Port on Windows CE Device

    help csharp c++ com
    8
    0 Votes
    8 Posts
    3 Views
    CPalliniC
    OK, got it, thank you very much. By the way: Microsoft, oh my God! :-) THESE PEOPLE REALLY BOTHER ME!! How can they know what you should do without knowing what you want done?!?! -- C++ FQA Lite
  • CMenu with Bitmap icon

    graphics algorithms help tutorial question
    9
    0 Votes
    9 Posts
    0 Views
    D
    I done it!!!! I did so: 1) OnCreate i put this as you told me: CMFCToolBar::AddToolBarForImageCollection(IDR_MAINFRAME_256); in Contextmenu i add these lines: CMFCPopupMenu* PopupMenuFolders = new CMFCPopupMenu(); //Mi serve controllare prima che esce il menu per eventualmente eliminare voci del menu non permesse. CheckWhatCanIDo(ExtractFullTreePath(htSelectedTreeItem),MainComputerinfo.szSid,m_bUserAuthorizations); PopupMenuFolders->InsertItem(CMFCToolBarMenuButton(ID_POPUP_FOLDERS_TREE_1, NULL, 0, _T("Item 1"))); PopupMenuFolders->InsertItem(CMFCToolBarMenuButton(ID_POPUP_FOLDERS_TREE_2, NULL, 1, _T("Item 2"))); PopupMenuFolders->InsertItem(CMFCToolBarMenuButton(ID_POPUP_FOLDERS_TREE_3, NULL, 2, _T("Item 3"))); PopupMenuFolders->Create(this, point.x, point.y, NULL); So you use directly the Toolbar Images. Thanks all ;) Giovanni
  • 0 Votes
    1 Posts
    0 Views
    No one has replied
  • How to fix the first column of a CListView in MFC

    help c++ tutorial
    2
    0 Votes
    2 Posts
    0 Views
    D
    See here. "One man's wage rise is another man's price increase." - Harold Wilson "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 "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
  • 0 Votes
    9 Posts
    1 Views
    S
    I can only agree with Richard. I've had a look at some of your questions and found that you're lacking the most fundamental understanding on how to properly write and test a program in C. Please do yourself and everyone else a favor and use a proper C book or tutorial. One of the first links I found on that topic is this: http://www.cprogramming.com/tutorial/c-tutorial.html[^] . Read that tutorial, take your time to understand what it teaches you. Make sure to actually try out the program snippets. Learn how to set up your working environment: compiler, linker, debugger. Once you've done that you'll save a lot of time because you won't need to ask about such basic problems. Learning C will take a considerable amount of time. But not learning it properly will cost you even more time in the long run, and others as well! GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)
  • How to Resolve the Below Error?

    help tutorial question
    3
    0 Votes
    3 Posts
    0 Views
    S
    Thanks Vrry Much For Resolving the error...... Superman_ :thumbsup:
  • Visual Studio, Register Window

    csharp c++ visual-studio tutorial question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Displaying the output of another program

    4
    0 Votes
    4 Posts
    0 Views
    L
    I still don't see the point. All of those functions will run perfectly in their own console window so what is the benefit of "It"?
  • battleship game code using c language

    game-dev help
    3
    0 Votes
    3 Posts
    1 Views
    U
    If you are learning to code, then asking others to code for you is not the way to go. If you are having trouble getting started, you should put some effort into making the game yourself, and then ask when you run into problems.
  • 0 Votes
    14 Posts
    0 Views
    A
    Best answer really... I have yet to see a "code converter" that did a good job without generating cluttered, hard to read code (that can run slow compared to if you have just done the conversion manually).