Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
V

vasanth1004

@vasanth1004
About
Posts
12
Topics
6
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Callback function arguments
    V vasanth1004

    Basically, I am writing an openGL library to render a scene multiple times from different viewpoints. So, the way my design works is I have the user pass in a pointer to their "Draw()" function (callback method), and my dll can call the Draw function multiple times, with different configurations each time. This is done so that the user doesn't have to explicitly call the Draw function multiple times. My DLL code can work fine if there were no arguments, or I knew the arguments. eg: typedef void (__stdcall *Draw)(void); But what if the user's Draw method had many arguments? How would I change the prototype in the dll to reflect this? This is my problem. Thanks for your help.

    C / C++ / MFC question

  • Callback function arguments
    V vasanth1004

    The reason I need to do this, is because my dll needs to support an arbitrary callback function. The user would "register" the callback function with the dll, by passing a function pointer. However, I need to have a prototype inside the dll anyways to callback any function. I was thinking I could make the user pass in the parameters, and number of parameters when the function is registered, then I could push it on the stack with inline assembly before I call the function. However, this is a little bit tardy way of doing it. Any better suggestions? Thanks

    C / C++ / MFC question

  • Callback function arguments
    V vasanth1004

    I'm writing a DLL that has to call a function after a certain event. However from all the articles I've read, you need to declare a function prototype inside the dll to be able to properly call the function. Eg : typedef int (CALLBACK *someFunction)(const byte*, const byte*); But what if I want to callback a function that has an arbitrary number of arguments, or return value? Thanks.

    C / C++ / MFC question

  • CSplitterWnd in CMDIFrameWnd NOT CChildFrame
    V vasanth1004

    I need the MainFrame of my MDI app to be split (with CSplitterWnd), and subsequent CViews to be created in one of the CSplitterWnds. Is this possible? Basically, I'm trying to get the MS Outlook look (the sidebar) in an MDI app. Thanks

    C / C++ / MFC question

  • Opening a document (MDI)
    V vasanth1004

    This doesn't work, I just get a debug assertion. Any other ideas?

    C / C++ / MFC question

  • Opening a document (MDI)
    V vasanth1004

    I want to open a document from within my CDocument derived class (MDI App). How do I do this? From what I've read when I was trying to solve this, CWinApp calls CDocManager, which then uses CDocTemplate, and then OnOpenDocument. But, how do I do all this from within my CMyDoc class? Thanks

    C / C++ / MFC question

  • Opening a document (MDI)
    V vasanth1004

    How do I open a document from within my CDocument derived class? I tried CMyDoc::OnOpenDocument(LPCTSTR pathname), but that doesn't work.

    C / C++ / MFC question

  • Calling CDocument::OnOpenDocument(LPCTSTR lpszPathName)
    V vasanth1004

    Hi, whenever I try to call OnOpenDocument within a function in my CDocument derived class, I get a debug assertion that I can't understand/ Example: void CMyDoc::Whatever() { //call OnOpenDocument with pathname CMyDoc::OnOpenDocument("C:\\whatever.txt"); } This will cause a debug assertion at: if (!CRichEditDoc::OnOpenDocument(lpszPathName)) return FALSE; How do I fix this? It crashes on AssignCopy(SafeStrlen(lpsz), lpsz); at STRCORE.cpp Thanks

    C / C++ / MFC question c++ debugging help tutorial

  • Reading CArchive in Serialize
    V vasanth1004

    The Strings?

    C / C++ / MFC question

  • Reading CArchive in Serialize
    V vasanth1004

    DavidCrow wrote: So what did you do that made it stop working? Sorry, I was wrong. It didn't work the way I wanted to: it reads it but also removes the string from the Archive. Basically I just want to read the contents of the current document into a String without removing what I read from the Archive. How do I do that?

    C / C++ / MFC question

  • Reading CArchive in Serialize
    V vasanth1004

    What I had originally works, but it removes the string from the archive. I also tried creating a new archive by getting the filename from the passed archive, but it didn't make a difference. Thanks

    C / C++ / MFC question

  • Reading CArchive in Serialize
    V vasanth1004

    I'm trying to read whatever is stored in my document inside the Serialize method But, whenever I read into a string from the archive, it takes out that string from the archive. Thus, when I call the Baseclass serialize, the outputted Document is missing the string that was read. Is there a way to read such that the string is not taken out from the archive? I tried reading the string after I called the base class serialize, but I get only an empty string. Thanks, (code is below). void CRichedDoc::Serialize(CArchive& ar) { CString buf; ar.ReadString(buf); CRichEditDoc::m_bRTF = FALSE; CRichEditDoc::Serialize(ar); }

    C / C++ / MFC question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups