Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ActiveX Control Compilation

Status
Not open for further replies.

kerneldelta

Programmer
Jul 7, 2003
4
GB
I'm running Visual C++ 6.0 under windows98
I'm just trying to do an example ActiveX Control
I create a blank ActiveX Control using the
MFC ActiveX ControlWizard
If I then build it, the build info is as follows...

Creating Type Library...
Processing D:\progs\Vc\UsingVC5\Chapter17\Dieroll\Dieroll.odl
Dieroll.odl
Processing D:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\oaidl.idl
oaidl.idl
Processing D:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\objidl.idl
objidl.idl
Processing D:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\unknwn.idl
unknwn.idl
Processing D:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\wtypes.idl
wtypes.idl
Compiling resources...
Compiling...
StdAfx.cpp
Compiling...
Dieroll.cpp
DierollCtl.cpp
DierollPpg.cpp
Generating Code...
Linking...
Creating library Debug/Dieroll.lib and object Debug/Dieroll.exp
Registering ActiveX Control...

It then just hangs.
I'd be very grateful if anyone could cast any light
on this

TIA
 
OK I'll answer my own question.
The final step of the build is to register the ActiveX Control and
so it must be resvr32 that hangs. However I can get round this as
follows:
In Project/Settings/Custom Build I find:

Description:
Registering ActiveX Control

Commands:
regsvr32 /s /c "$(TargetPath)"
echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"

Outputs:
$(OutDir)\regsvr32.trg

This has presumably been generated by the MFC ActiveX ControlWizard.

If I remove it, Visual Studio/C++ doesn't try to register the control
as the last step in the build & so the build works fine. When it's
finished I can register the control by Tools/Register Control.
Furthermore I can then insert the control into the ActiveX Control
Test Container. If this works, I still can't understand why putting
the registration in the Project/Settings/Custom Build doesn't work.

But now I've got another problem:

I construct an ActiveX Container Application with the MFC AppWizard(exe)
It's completely blank - no code of my own inserted. If I then run it and
choose Edit/Insert New Object it goes into dlg.DoModal() in
CShowStringView::OnInsertObject()

.............................................................................
void CShowStringView: :OnInsertObject()
{
// Invoke the standard Insert Object dialog box to obtain information
// for new CShowStringCntrItem object.
COleInsertDialog dlg;
if (dlg.DoModal() != IDOK)
return;
.............................................................................


When it gets into dlg.DoModal() it goes into MapResult and the program then
just hangs

.............................................................................
int COleInsertDialog::DoModal()
{
ASSERT_VALID(this);
ASSERT(m_io.lpfnHook != NULL); // can still be a user hook

m_io.hWndOwner = PreModal();
int iResult = MapResult:):OleUIInsertObject(&m_io));
PostModal();
return iResult;
}
.............................................................................



I'd be very grateful if anyone could help me solve the problem.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top