Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ActiveX for VB -> Problem

0 views
Skip to first unread message

Hans-Thomas Götz

unread,
Jan 24, 2002, 5:18:59 AM1/24/02
to
I am developing an ActiveX-Control with Visual C++ ( i don't use ATL or
MFC ) for Visual Basic. I have only little experience with ActiveX-Controls
and no experience with VB. The ActiveX-Control-part works well with the
ActiveX-Control-Test-Container, but it hangs with VB if i add a
command-button to the form. The problem is, that when VB wants to save the
control it keeps calling the IPersistStreamInit::Save() function and it
doesn't stop. Here is how i implemented the IPersistStreamInit::Save()
function:

HRESULT STDMETHODCALLTYPE ImplIPersistStreamInit::Save( /* [unique][in] */
IStream *pStm, /* [in] */ BOOL fClearDirty )
{
char dummy[ 10 ] = { 0 };
ULONG NumBytesWritten = 0;

EDM_DebugMessage( "IPersistStreamInit-Interface: called Save." );

if ( pStm != NULL ) {
// actually write some dummy data to the stream
pStm -> Write( ( void* ) dummy, 10, &NumBytesWritten ); // write 10 bytes
AdviseHolder -> SendOnSave();
} else {
return( E_UNEXPECTED );
}

AdviseHolder -> SendOnSave();

return( S_OK );
}

What am i doing wrong? Is there some documentation like "Programming
ActiveX-Controls for Visual Basic in C++" What are the equirements a
ActiveX-Control must meet to work with VB. Because it works with the
Testcontainer i assume that i have to meet some special requirements for VB.

Thanks in advance for the help.

Thomas

Hans-Thomas Götz

unread,
Jan 24, 2002, 7:22:53 AM1/24/02
to
Last thing i discovered is that vb doesn't create an advisory connection:
"AdviseHolder -> SendOnSave()" does nothing at all!!! Well, that may be the
problem about the saving, but why doesn't vb create an advisoryx
connection???

Thanks for the help.

Thomas

"Hans-Thomas Götz" <htg...@web.de> schrieb im Newsbeitrag
news:a2on5g$ben$03$1...@news.t-online.com...

0 new messages