Thread: OCX Problems!

  1. #1
    Registered User
    Join Date
    Nov 2004
    Posts
    69

    OCX Problems!

    Hi, Im new to this message board. I have a problem. In VC++ Im trying to add an OCX to a dialog box, but everytime I do, the dialog box won't come up, but it does without the OCX. Help please!

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    If it's an MFC application then make sure you're calling AfxEnableControlContainer(). This is typically done in the InitInstance() of your app object.

    More Information Here

    gg

  3. #3
    Registered User
    Join Date
    Nov 2004
    Posts
    69
    I included STDAFX just like it says, and added AfxEnableControlContainer(), but I get this error.

    StdAfx.cpp
    c:\program files\microsoft visual studio\vc98\mfc\include\afxv_w32.h(14) : fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>

  4. #4
    Registered User
    Join Date
    Nov 2004
    Posts
    69
    I figured it out thanks! I just used the wizard =D

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. No clue how to make a code to solve problems!
    By ctnzn in forum C Programming
    Replies: 8
    Last Post: 10-16-2008, 02:59 AM
  2. C Pointers Problems
    By mhelal in forum C Programming
    Replies: 8
    Last Post: 01-10-2007, 06:35 AM
  3. String Manipulation problems -_-
    By Astra in forum C Programming
    Replies: 5
    Last Post: 12-13-2006, 05:48 PM
  4. Rendering problems (DirectX?)
    By OnionKnight in forum Tech Board
    Replies: 0
    Last Post: 08-17-2006, 12:17 PM
  5. contest problems on my site
    By DavidP in forum Contests Board
    Replies: 4
    Last Post: 01-10-2004, 09:19 PM