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
J

jmostei

@jmostei
About
Posts
6
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Getting document pointer
    J jmostei

    no, it won´t work for sure. All is about getting the current view when creating the dialog. If you have the view, you have the doc with GetDocument(). From the dialog, you can get a pointer to the main frame with the method: GetParentFrame( ). Once you have the pointer to the frame, you can call its GetActiveView() method to get the current view. Thats all, i hope i have been usefull to you.

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

  • OLE problem with drag and drop
    J jmostei

    i have found it, and i wish i can help anyone who finds the same problem... The cuestion is that when you call the CacheData function, you must care every value in the STGMEDIUM and FORMATETC structures. A good idea is to make something like this: ZeroMemory(pMedium, sizeof(STGMEDIUM )) and ZeroMemory(pFormatetc, sizeof(FORMATETC )) before beginning to give values to its members. You must remember too that since these two structures are passed to CacheData() they arent owned by aplication, that means for example that you can do :)something like this: pMedium = new STGMEDIUM; ...; ...->CacheData(...,pMedium, ...); ...; delete pMedium; because this will surely cause a program´s crash.:)

    C / C++ / MFC help com question

  • OLE problem with drag and drop
    J jmostei

    i have found it, and i wish i can help anyone who finds the same problem... The cuestion is that when you call the CacheData function, you must care every value in the STGMEDIUM and FORMATETC structures. A good idea is to make something like this: ZeroMemory(pMedium, sizeof(STGMEDIUM )) and ZeroMemory(pFormatetc, sizeof(FORMATETC )) before beginning to give values to its members. You must remember too that since these two structures are passed to CacheData() they arent owned by aplication, that means for example that you can do :)something like this: pMedium = new STGMEDIUM; ...; ...->CacheData(...,pMedium, ...); ...; delete pMedium; because this will surely cause a program´s crash.:)

    C / C++ / MFC help com question

  • VC++ .net and serial communication
    J jmostei

    i wish i can send you a book through the net but it is still impossible if it is in phisical paper format ... I strongly recommend you ( if you find it ) "Advanced Programming on windows" by Jeffrey Richter. However if you arent such an adventure man and simply want to solve the problem by now, you have to find in the msdn the documentation about: CreateFile, WriteFile and ReadFile, and SetCommConfig. They are functions of windows api. Do not forget to include . With those four functions and a lot of error discovering efforts you will probably success in comunicating with serial port. I have done it before in my work but i dont have the code.:)

    C / C++ / MFC c++ csharp

  • Getting document pointer
    J jmostei

    yes, i supose that you have defined the message handler of this menu item in the view class. I supose too that you call de DoModal() function of the dialog class in this message handler. Therefore your´s dialog parent window is the view window. If you call the dialogs method: CWnd * GetParentWnd() and cast teh result to a (CDXtoXDView *). Just doing this: (CDXtoXDView *)GetParentWnd(), then you have a pointer to the view object. You just have to call GetDocument() view´s method to obtain the document pointer. This should work.;)

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

  • OLE problem with drag and drop
    J jmostei

    I have implemented drag and drop on my new aplication and i have a strange error. In InitInstance method of app object i call AfxInitOle() function. Lets we call source window A and target window B. In A´s OnCreate message handler i use the following code: medium.tymed = TYMED_FILE; medium.lpszFileName = (unsigned short *)((LPCSTR)(new CString("TempDragDrop.dat"))); source->CacheData(((CLightControllerApp *)AfxGetApp())->ID_FOCUS_FORMAT,&medium); In B´s OnCreate message handler i use the following code: target.Register(this); And on OnDestroy message handler of B window I use: target.Revoke(); I have no idea of what is going wrong, so please help me. Many thanks to all you and sorry for my poor english.

    C / C++ / MFC help com 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