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
M

Matt Gates

@Matt Gates
About
Posts
30
Topics
16
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • hWnd in COM Question.
    M Matt Gates

    I tried to add ATL to my dll but it says that ATL can only be added to regular MFC dll. Mine is an extension dll. Thanks for all the help guys, but I think I am in over my head here. I thought that once I got the basics down I could jump right and use MFC. All the books I have don't show any examples similar to what I am doing. I ordered some books on COM, MFC, and ATL today... Matt (Padawan Learner)

    COM question c++ com

  • Creating a dialog from a COM dll
    M Matt Gates

    I am trying to display a CDialog derived class froma dll using COM. The COM stuff is working. It seems that my dialog is failing to create its own m_hWnd: void __stdcall CMattDlgCmpnt::HtmlMsgBox( HWND wndParent, BSTR strmsg ) { CWnd* pWnd = new CWnd(); pWnd = CWnd::FromHandle(wndParent); CNormalDlg *wndNormalDlg = new CNormalDlg( pWnd ); wndNormalDlg->DoModal(); } Debugging yields the following: {CNormalDlg hWnd=0x00000000} I tried doing this as well: CNormalDlg *wndNormalDlg = new CNormalDlg( pWnd ); wndNormalDlg->Create(IDD_DIALOG1); wndNormalDlg->ShowWindow(SW_SHOW); But then I get an nasty ASSERT here: #ifdef _DEBUG if (!_AfxCheckDialogTemplate(lpszTemplateName, FALSE)) { **ASSERT(FALSE); // invalid dialog template name** PostNcDestroy(); // cleanup if Create fails too soon return FALSE; } Any ideas. Thanks. Matt (Padawan Learner)

    C / C++ / MFC com

  • hWnd in COM Question.
    M Matt Gates

    Getting closer, but no cigar yet. I passed in the parent like so: void __stdcall CMattDlgCmpnt::HtmlMsgBox( HWND wndParent, BSTR strmsg ) { CWnd* pWnd = new CWnd(); pWnd = CWnd::FromHandle(wndParent); CNormalDlg *wndNormalDlg = new CNormalDlg( pWnd ); wndNormalDlg->DoModal(); } It seems that the class is failing to create its own m_hWnd: {CNormalDlg hWnd=0x00000000} This may be a question for the C++ board but if you want to tkae a shot at it I'd appreciate it. Thanks. Matt (Padawan Learner)

    COM question c++ com

  • hWnd in COM Question.
    M Matt Gates

    Thanks. I will first try to pass the parent HWND in and try get things working that way. Then I will attempt the QI of the container. I suppose that underneath the hood that is what MessageBox and AfxMessageBox does, yes? Matt (Padawan Learner)

    COM question c++ com

  • hWnd in COM Question.
    M Matt Gates

    I am stumbling my way through COM and have hit a snag. I can get a MessageBox to work from a call to my component but I cannot get a CDialog derived class to display. Every thing runs fine but the CDialog derived class has hWnd=0xcccccccc which means nothing happens when I call DoModal(). I am using a MFC extension dll to serve up the components. What gives? Thanks for your time. void __stdcall CMattDlgCmpnt::SimpleMsgBox( HWND wndParent, BSTR strmsg ) { ... //This Works MessageBox ( wndParent, strTxt, _T("Simple Message Box"), MB_OK ); return; } void __stdcall CMattDlgCmpnt::HtmlMsgBox( HWND wndParent, BSTR strmsg ) { CNormalDlg wndNormalDlg; //This does not work wndNormalDlg.DoModal(); //hWnd=0xcccccccc Nothing Happens } Matt (Padawan Learner)

    COM question c++ com

  • DllMain issues
    M Matt Gates

    Thanks. That got me thinking that my project was not setup as it should be. And low and behold it was not. I needed to be using a MFC Extension dll. Everything works great now. Dumb mistake, but like I said, I am new to COM(and to dlls). Matt (Padawan Learner)

    COM c++ com question

  • DllMain issues
    M Matt Gates

    I am new to COM and am building a simple MFC dll to get things going. I have everything working except that when I include DllMain in my code the linker balks and tells me that dllmain is already defined in my .obj file. Any ideas? TIA. Matt (Padawan Learner)

    COM c++ com question

  • CDHTMLDialog Scroll ?
    M Matt Gates

    Thanks! Matt (Padawan Learner)

    C / C++ / MFC c++ visual-studio question csharp html

  • CDHTMLDialog Scroll ?
    M Matt Gates

    What the heck is this and why did it fix my problem? BOOL CAutoDlg::OnInitDialog() { SetHostFlags(DOCHOSTUIFLAG_NO3DBORDER);//enables scrolling??? CDHtmlDialog::OnInitDialog(); .... } Matt (Padawan Learner)

    C / C++ / MFC c++ visual-studio question csharp html

  • CDHTMLDialog Scroll ?
    M Matt Gates

    Could someone please let me know how I can get my CDHTMLDialog to scroll. I have tried "scroll = yes" in the Body tag of the html and setting the scrollbars in the dialog editor itself but niether seems to work. I have another app that scrolls just fine but his one will not cooperate. Any ideas. This must be a common newbie question :-O IDE: Visual Studio 2002 Lang: C++. Project: MFC Dialog Based TIA. Matt (Padawan Learner)

    C / C++ / MFC c++ visual-studio question csharp html

  • MFC ODBC Consumer Wizard Crashes
    M Matt Gates

    Anyone know why VC++7 completely craps out when you change the name of the class or the .cpp or the .h files to be created in the MFC ODBC Consumer Wizard? Am I the only one with this problem? The OBDC driver is MySQL 3.51. Matt (Padawan Learner)

    C / C++ / MFC c++ mysql help question

  • Query Works in Access But Not in App
    M Matt Gates

    Wow, solved my own problem. For those interested, these articles helped me out: ACC: Running Stored Access Queries with Wildcards via ODBC May Return Incorrect Results OLE DB Provider for Microsoft Jet Matt (Padawan Learner)

    Database database question

  • Query Works in Access But Not in App
    M Matt Gates

    I am new to DB programming in VC. Any Idea why this SQL statement will not return any results in my program: SELECT * FROM Table WHERE Field1 LIKE "*text*" AND Field2 LIKE "*txt*"; The query runs fine in Access 2002 but will not return any results in my VC app. "Microsoft.Jet.OLEDB.4.0" is my provider when connecting to the Acesss DB. I tried to use "Microsoft Access Driver" but that throws an exception because it can not be found(???). Thanks for any suggestions. Matt (Padawan Learner)

    Database database question

  • Changing exe name.
    M Matt Gates

    Got it. Thanks. Matt (Padawan Learner)

    C / C++ / MFC csharp c++ question

  • Changing exe name.
    M Matt Gates

    Where in VC++.NET do I change the name of the exe file? Thanks. Matt (Padawan Learner)

    C / C++ / MFC csharp c++ question

  • Getting Selection from CHTMLEditView
    M Matt Gates

    Thanks a lot, that article did the trick. Matt (Padawan Learner)

    C / C++ / MFC question

  • Getting Selection from CHTMLEditView
    M Matt Gates

    Thanks, that should get me going in the right direction. I don't suppose you have a link to that article? Matt (Padawan Learner)

    C / C++ / MFC question

  • Getting Selection from CHTMLEditView
    M Matt Gates

    I would like to get at the selection in a CHTMLEditView so I can modify it and reinsert it back in to the view. Specifically I am looking to add the option to format the selection as a superscript or subscript. If I can get what is selected on screen into a CString I will be 90% there. Any suggestions? TIA Matt (Padawan Learner)

    C / C++ / MFC question

  • ATL Error when builing release version
    M Matt Gates

    Anyone have trouble building the release version of their MFC project w/ ATL support after it builds and runs just fine in debug mode? If so, what did you do to solve the problem? Thanks again. Matt (Padawan Learner)

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

  • Automating Word2002
    M Matt Gates

    I am trying to automate word in an MFC application. I have followed the various tutorials for other office applications. When I try to automate word, what is the same of the header file I need to include. For example I was using excel.h for Excel2002. TIA. Matt (Padawan Learner)

    C / C++ / MFC c++ tutorial 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