Skip to content

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
  • VB Control Arrays in VC++?

    c++ data-structures question
    1
    0 Votes
    1 Posts
    5 Views
    No one has replied
  • How do I extract drive name from file path?

    question sysadmin
    3
    0 Votes
    3 Posts
    12 Views
    C
    Have a look at the _splitpath API function... - Chris ================== The original message was: I've got a set of filenames: some are to files which exist, others are to files which do not exist; some are absolute, others are relative; some are on local drives, others on network drives. I'm looking for a way to extract the drive name from a file path, regardless of any of the above factors. Can anyone give me a pointer of where to look for this? Thanx.
  • 0 Votes
    3 Posts
    17 Views
    M
    Read up on WM_GETMINMAXINFO. Windows sends this to you as the user is resizing the window. You fill in a MINMAXINFO struct with the min/max sizes, and Windows will not let the window be sized outside of those bounds. --Mike-- ================== The original message was: a window is resizable, but when the length of window excede 300 pixels (for example), it can NOT make larger and stop resizing. How ? Thanks in advanced
  • CList with user defined type is not working

    c++ database question
    4
    0 Votes
    4 Posts
    24 Views
    L
    I think I've found the problem. CList doesn't provide a copy or an assignement operater witch is needed. So it is not possible to store a clist or a carray within a clist or a carray. But this is what i need!
  • ATL and backgroud image

    c++ question
    2
    0 Votes
    2 Posts
    15 Views
    A
    Hi! There is no any problems of using the AtlComPtrAssign() method if you are creating the ATL project using MSVC wizard (I've tried it). If you are adding ATL support to an existing MFC application you can follow this steps: 1. From ClassView, select the project to which you want to add ATL support, and click the right mouse button. 2. From the popup menu, click New ATL Object. 3. When prompted, click Yes to add ATL support. 4. From the ATL Object Wizard dialog, select the object you want to add. Note If you only want ATL support without adding any ATL objects, click Cancel in the ATL Object Wizard. Good luck, Alex Gorev, Dundas Software. ================== The original message was: Hello, I am trying to add a background image to a control. I was trying to use Mihai Filimon's method (see Adding background image to any control) but I am have 3 link errors, live "unresolved external... AtlComPtrAssign(..) ). I added atl.lib to my project settings. Is there any other thing I might have forgotten to do? Thank you.
  • Multiply Views and document

    c++ announcement
    1
    0 Votes
    1 Posts
    6 Views
    No one has replied
  • chars above 127 not geting printed

    c++ help
    3
    0 Votes
    3 Posts
    16 Views
    D
    Thanks for your kind suggestions Gary. I was using Foxpro ODBC 2.5. Then I used Visual Foxpro ODBC Driver & the problem was solved. ================== The original message was: It will depend on the font that you are using. I assume you are trying to print out characters like the box drawing ones (or foreign language chars). Many of the Windows fonts map only to a small square box (or some other boring shape) for chars above 127. Some of the OEM terminal fonts may be more useful for you. Of course it could be something else that isn't right. You should probably also check if you are using Unicode or not and make sure you are casting your strings with TCHAR - this could impact on it as well. Another thing would be the default language you are using. Regards, Gary Menzel ================== The original message was: I am using vc++ 6.00 and I am using drawtext to output text. I am not able to print characters above ascii 127. I tried to make them unsigned char, I also tried the /J option but nothing happens. Please help me.
  • moving caret in CEditView

    tutorial question
    3
    0 Votes
    3 Posts
    16 Views
    L
    CRichEditCtrl::SetSel(startPos, endPos); If you don't want any highlighted text, then make sure that startPos == endPos.
  • How to get the caret's position in a richedit?

    tutorial question
    2
    0 Votes
    2 Posts
    11 Views
    L
    long startChar, endChar; GetRichEditCtrl().GetSel(startChar, endChar); startChar marks the start of the selection and endChar the end. If there is no current selection then the two values will be the same and will indicate the position of the caret.
  • How to change mouse cursor when move mouse pass the button?

    tutorial question
    3
    0 Votes
    3 Posts
    18 Views
    G
    There are two possible ways of implementing this (that I know of). Both of them include trapping either one or both of the MOUSEMOVE or SETCURSOR messages. You can either trap them at level of the main FrameWnd or in the Button (I would personally prefer to subclass the Button and trap it in there so I could reuse that new button in other parts of my code). In the case of trapping it in the FrameWnd (probably trapping MOUSEMOVE after you know the cursor is in the FrameWnd - using SETCURSOR to set some flag) you then need to work out if the mouse is over the button to change to the IBEAM cursor - as well as not over the button to change it back!!). There are probably other pitfalls to worry about that my simple explanation doesn't cover but they would be the two basic approaches to consider. Regards, Gary Menzel ================== The original message was: How to change mouse cursor to "IDC_IBEAM" when move mouse pass the button?
  • CVS addin?

    visual-studio collaboration tutorial question announcement
    3
    0 Votes
    3 Posts
    14 Views
    N
    You may want to have a look at CS-RCS which is based on GNU RCS and integrates with VC++. Their site is http://www.componentsoftware.com/ Neville Franks - Author of ED for Windows www.getsoft.com ================== The original message was: Does anybody knows how to integrate CVS version control with the Visual Devstudio IDE? My company is migrating there right now(BIG mistake), so I am trying to find a civilized way to work with it instead of the command line or WinCVS things... Is there any addin available?
  • ATL Exe Server Problem

    c++ csharp visual-studio com sysadmin
    2
    0 Votes
    2 Posts
    8 Views
    A
    Hi Mike! You should use the #import directive with the name of your TLB file. You can find more information about it in MSDN. Regards, Alex Gorev, Dundas Software. ================== The original message was: I am needing to create a Singleton COM component. This needs to have data served to several programs so of course needs to be an out of process server which leads me to using the ATL EXE server rather than a DLL or a MFC based COM object. It appears that I can create one rather straight forward from the ATL wizard under the new option in Visual Studio 6. However I am missing something. Although I can see the created component in the OleViewer via its TypeLib I can not access it to use in any programs. When trying to add it via "Project/AddtoProject/ComponentsAndControls" I get a message "File Does Not Exist". Any pointers on what I am missing. Thanks Mike.
  • How to make StatusBar tooltips?

    tutorial question
    3
    0 Votes
    3 Posts
    16 Views
    L
    Have you tried: SendMessage ( hStatusBarWnd, SB_SETTIPTEXT, (WPARAM)(INT)iStatusBarPart, (LPARAM)(LPCTSTR)lpcszTextToDisplayAsTooltip ); code sequence? The status bar window must be created (as in the following example) using g_hStatusBarWnd = CreateWindowEx ( 0L, STATUSCLASSNAME, 0, WS_CHILD | WS_VISIBLE | SBT_TOOLTIPS, 0, 0, 0, 0, hParentWnd, (HMENU)ID_STATUSBAR, g_hInstance, 0 ); For more information, you can check the WindowsNT System Manager, where you can find, among other stuff like this, also something about status bar APIs. All the best, Sardaukar ================== The original message was: How could I make status bar to show tool tips for its panes? Regards, Stefan ----------
  • Dynamic CEdit Control

    1
    0 Votes
    1 Posts
    3 Views
    No one has replied
  • mirror image of a page (problem)

    help
    1
    0 Votes
    1 Posts
    7 Views
    No one has replied
  • Shared Directory

    question
    6
    0 Votes
    6 Posts
    26 Views
    T
    i'm on 98 not NT and if you can send to mu e-mail some code examples it will be very good. Thierry
  • Question about dll

    help question
    2
    0 Votes
    2 Posts
    12 Views
    A
    Hi! You have to declare the class as "__declspec(dllimport)". And you also have to include the *.LIB file for your DLL. You can do this in the Link section of your project settings or by inserting the pragama in the source code. For example: #pragma comment(lib, "MyClass.lib") Regards, Alex Gorev, Dundas Software. ================== The original message was: I developed a dll with a class exported. In my application, I declare an object of it and call one of its member functions. I got the following link time error: error LNK2001: unsolved external symbol "__declspec(dllimport) public:void __thiscall testclass::function(char const *)" (__imp_?Export@testclass@@QAEXPBD@Z) When I look at the dll, I see ... 314 139 00001131 ?function@testclass@@QAEXPBG@Z Apparently there is a mismatch here. I would like to know the reason of this problem. Any ideas?
  • Disk space lists: any examples?

    database help tutorial question announcement
    1
    0 Votes
    1 Posts
    4 Views
    No one has replied
  • DevStudio: AddToolSettings not recognized

    question workspace
    1
    0 Votes
    1 Posts
    5 Views
    No one has replied
  • Memory Leak ???

    c++ question performance help career
    2
    0 Votes
    2 Posts
    10 Views
    J
    The problem does not seem to be with this code. If you dynamically created an object of type CPumpMessageView make sure you destroy the object before the application object terminates. If this is not your problem please post the object dump so that I can better understand the problem.