DirectX and ActiveX DLL's 
Author Message
 DirectX and ActiveX DLL's

Hi all.

I was crating a simple engine for 2D blitting and such using DirectX.  I
wanted to wrap the thing up as an ActiveX DLL, which I did.  But, whenever I
try to pass a reference to a DirectX object (specifically
DirectDrawSurface7) from the application to the DLL (or visa-versa), I get
some funky errors.

Can anybody help me understand why this is?  I thought it might have
something to do with how VB multithreads ActiveX components and DLLs, but I
figured this probably wouldn't account for what I'm experiencing.

Thanks in advance,

Mark Biddlecom



Thu, 30 Sep 2004 07:20:57 GMT  
 DirectX and ActiveX DLL's
Hi Mark,

Wrapping your code up into a DLL is possible with DirectX.  What kind of
errors were you getting?

--
Eric DeBrosse
http://www.blown.com/dx/
Microsoft Visual Basic DirectX MVP

The opinions expressed in this message are my own personal views and
do not reflect the official views of Microsoft Corporation. The MVP program
does not constitute employment or contractual obligation with Microsoft.


Quote:
> Hi all.

> I was crating a simple engine for 2D blitting and such using DirectX.  I
> wanted to wrap the thing up as an ActiveX DLL, which I did.  But, whenever
I
> try to pass a reference to a DirectX object (specifically
> DirectDrawSurface7) from the application to the DLL (or visa-versa), I get
> some funky errors.

> Can anybody help me understand why this is?  I thought it might have
> something to do with how VB multithreads ActiveX components and DLLs, but
I
> figured this probably wouldn't account for what I'm experiencing.

> Thanks in advance,

> Mark Biddlecom



Thu, 30 Sep 2004 07:57:39 GMT  
 DirectX and ActiveX DLL's
It gave me an Automation Error when I tried to pass a reference to my
DirectDraw7 object from the app to the DLL.  I tried debugging this (using
one instance of VB as the DLL server and another instance as the client),
and the error seemed to occur right when the function call is made--it never
makes it inside the DLL code.

-Mark

Quote:
----- Original Message -----

Newsgroups: microsoft.public.vb.directx
Sent: Saturday, April 13, 2002 7:57 PM
Subject: Re: DirectX and ActiveX DLL's

> Hi Mark,

> Wrapping your code up into a DLL is possible with DirectX.  What kind of
> errors were you getting?

> --
> Eric DeBrosse
> http://www.blown.com/dx/
> Microsoft Visual Basic DirectX MVP

> The opinions expressed in this message are my own personal views and
> do not reflect the official views of Microsoft Corporation. The MVP
program
> does not constitute employment or contractual obligation with Microsoft.



> > Hi all.

> > I was crating a simple engine for 2D blitting and such using DirectX.  I
> > wanted to wrap the thing up as an ActiveX DLL, which I did.  But,
whenever
> I
> > try to pass a reference to a DirectX object (specifically
> > DirectDrawSurface7) from the application to the DLL (or visa-versa), I
get
> > some funky errors.

> > Can anybody help me understand why this is?  I thought it might have
> > something to do with how VB multithreads ActiveX components and DLLs,
but
> I
> > figured this probably wouldn't account for what I'm experiencing.

> > Thanks in advance,

> > Mark Biddlecom



Thu, 30 Sep 2004 09:06:00 GMT  
 DirectX and ActiveX DLL's
I'm assuming you can call other methods in your DLL, just not methods that
pass the DirectDraw object?  Does the Err object give us any further clues
as to what might be wrong?  I suppose a lot of things can cause an
automation error.

What do you get when you compile the DLL, copy it to your windows folder,
close all instances of VB, run the DLL through REGSVR32.EXE, start a new
instance of VB and add a new reference to the DLL?  Is there any situation
where you can get the DLL to work?  Can you narrow it down to a small piece
of sample code?

Hoping this helps,

--
Eric DeBrosse
http://www.blown.com/dx/
Microsoft Visual Basic DirectX MVP

The opinions expressed in this message are my own personal views and
do not reflect the official views of Microsoft Corporation. The MVP program
does not constitute employment or contractual obligation with Microsoft.


Quote:
> It gave me an Automation Error when I tried to pass a reference to my
> DirectDraw7 object from the app to the DLL.  I tried debugging this (using
> one instance of VB as the DLL server and another instance as the client),
> and the error seemed to occur right when the function call is made--it
never
> makes it inside the DLL code.

> -Mark



Thu, 30 Sep 2004 11:12:52 GMT  
 DirectX and ActiveX DLL's
Well, I just did two things and the error seems to have simply disappeared.
(I shouldn't have done them simultaneously, but I wasn't paying attention
:-P.)  Anyway, first off, I installed WindowsXP and reinstalled Visual
Enterprise Studio 6 and Visual Studio.NET Professional.  Secondly, I rewrote
the code such that the reference to the DirectX objects are created within
the DLL (by an initialization function called by the client).

Somehow, these two circumstances have meshed together to completely wipe out
the problem.  The DLL can now pass a reference to DirectDraw7 from itself to
the client--I don't know about the other way around since the need for that
simply doesn't exist.

Naturally, whenever bugs simply "disappear" it can be alarming.  I could
rewrite the code to force the client to create the DirectX objects--not
without pain, of course--but I can't (at least, I'm not willing to)
uninstall Windows XP.

My question, therefore, now becomes "will the application still run on
computers with Windows 2000, 98, or Me?"

I'm still screwing around with the code to see if I can break it again (does
that make me {*filter*}ic?), but so far no luck.  I suppose that could be a
good thing.

Thanks for you help,

Mark



Quote:
> I'm assuming you can call other methods in your DLL, just not methods that
> pass the DirectDraw object?  Does the Err object give us any further clues
> as to what might be wrong?  I suppose a lot of things can cause an
> automation error.

> What do you get when you compile the DLL, copy it to your windows folder,
> close all instances of VB, run the DLL through REGSVR32.EXE, start a new
> instance of VB and add a new reference to the DLL?  Is there any situation
> where you can get the DLL to work?  Can you narrow it down to a small
piece
> of sample code?

> Hoping this helps,

> --
> Eric DeBrosse
> http://www.*-*-*.com/
> Microsoft Visual Basic DirectX MVP

> The opinions expressed in this message are my own personal views and
> do not reflect the official views of Microsoft Corporation. The MVP
program
> does not constitute employment or contractual obligation with Microsoft.



> > It gave me an Automation Error when I tried to pass a reference to my
> > DirectDraw7 object from the app to the DLL.  I tried debugging this
(using
> > one instance of VB as the DLL server and another instance as the
client),
> > and the error seemed to occur right when the function call is made--it
> never
> > makes it inside the DLL code.

> > -Mark



Thu, 30 Sep 2004 23:28:34 GMT  
 DirectX and ActiveX DLL's
Hi Mark,

Sometimes there just are no good explanations for the crazy things computers
do. :)

Quote:
> Somehow, these two circumstances have meshed together to completely wipe
out
> the problem.

It is possible, I suppose, there was a problem with your Visual Studio
installation.

Quote:
> The DLL can now pass a reference to DirectDraw7 from itself to
> the client--I don't know about the other way around since the need for
that
> simply doesn't exist.

You should be able to do it the other way around as well, I have done it
both ways without any problems.

Quote:
> My question, therefore, now becomes "will the application still run on
> computers with Windows 2000, 98, or Me?"

Yes, DirectX supports 2000, 98, Me, etc.  I've recently switched to XP for
my development machince, have not had any problems with compatability.

Cheers,

--
Eric DeBrosse
http://www.blown.com/dx/
Microsoft Visual Basic DirectX MVP

The opinions expressed in this message are my own personal views and
do not reflect the official views of Microsoft Corporation. The MVP program
does not constitute employment or contractual obligation with Microsoft.



Fri, 01 Oct 2004 02:10:50 GMT  
 DirectX and ActiveX DLL's



Quote:
> Hi Mark,

> Sometimes there just are no good explanations for the crazy things
computers
> do. :)

> > Somehow, these two circumstances have meshed together to completely wipe
> out
> > the problem.

> It is possible, I suppose, there was a problem with your Visual Studio
> installation.

> > The DLL can now pass a reference to DirectDraw7 from itself to
> > the client--I don't know about the other way around since the need for
> that
> > simply doesn't exist.

> You should be able to do it the other way around as well, I have done it
> both ways without any problems.

> > My question, therefore, now becomes "will the application still run on
> > computers with Windows 2000, 98, or Me?"

> Yes, DirectX supports 2000, 98, Me, etc.  I've recently switched to XP for
> my development machince, have not had any problems with compatability.

> Cheers,

> --
> Eric DeBrosse
> http://www.blown.com/dx/
> Microsoft Visual Basic DirectX MVP

> The opinions expressed in this message are my own personal views and
> do not reflect the official views of Microsoft Corporation. The MVP
program
> does not constitute employment or contractual obligation with Microsoft.



Fri, 01 Oct 2004 04:23:21 GMT  
 DirectX and ActiveX DLL's



Quote:
> Hi Mark,

> Sometimes there just are no good explanations for the crazy things
computers
> do. :)

> > Somehow, these two circumstances have meshed together to completely wipe
> out
> > the problem.

> It is possible, I suppose, there was a problem with your Visual Studio
> installation.

> > The DLL can now pass a reference to DirectDraw7 from itself to
> > the client--I don't know about the other way around since the need for
> that
> > simply doesn't exist.

> You should be able to do it the other way around as well, I have done it
> both ways without any problems.

> > My question, therefore, now becomes "will the application still run on
> > computers with Windows 2000, 98, or Me?"

> Yes, DirectX supports 2000, 98, Me, etc.  I've recently switched to XP for
> my development machince, have not had any problems with compatability.

> Cheers,

> --
> Eric DeBrosse
> http://www.blown.com/dx/
> Microsoft Visual Basic DirectX MVP

> The opinions expressed in this message are my own personal views and
> do not reflect the official views of Microsoft Corporation. The MVP
program
> does not constitute employment or contractual obligation with Microsoft.



Fri, 01 Oct 2004 04:23:27 GMT  
 DirectX and ActiveX DLL's



Quote:
> Hi Mark,

> Sometimes there just are no good explanations for the crazy things
computers
> do. :)

> > Somehow, these two circumstances have meshed together to completely wipe
> out
> > the problem.

> It is possible, I suppose, there was a problem with your Visual Studio
> installation.

> > The DLL can now pass a reference to DirectDraw7 from itself to
> > the client--I don't know about the other way around since the need for
> that
> > simply doesn't exist.

> You should be able to do it the other way around as well, I have done it
> both ways without any problems.

> > My question, therefore, now becomes "will the application still run on
> > computers with Windows 2000, 98, or Me?"

> Yes, DirectX supports 2000, 98, Me, etc.  I've recently switched to XP for
> my development machince, have not had any problems with compatability.

> Cheers,

> --
> Eric DeBrosse
> http://www.blown.com/dx/
> Microsoft Visual Basic DirectX MVP

> The opinions expressed in this message are my own personal views and
> do not reflect the official views of Microsoft Corporation. The MVP
program
> does not constitute employment or contractual obligation with Microsoft.



Fri, 01 Oct 2004 04:24:37 GMT  
 DirectX and ActiveX DLL's
just to be perfectly clear:

DirectX 8.0 supported Windows 95, 98 and 98SE, Me, and 2000.

DirectX 8.1 supports Windows 98, 98SE, Me, 2000, and XP.

the 8.1 SDK can be used to develop for either 8.0 or 8.1, be sure to use the
8.0 constant when initializing D3D for 8.0 ( SDK version = 120 ) behavior.



Quote:
> Hi Mark,

> Sometimes there just are no good explanations for the crazy things
computers
> do. :)

> > Somehow, these two circumstances have meshed together to completely wipe
> out
> > the problem.

> It is possible, I suppose, there was a problem with your Visual Studio
> installation.

> > The DLL can now pass a reference to DirectDraw7 from itself to
> > the client--I don't know about the other way around since the need for
> that
> > simply doesn't exist.

> You should be able to do it the other way around as well, I have done it
> both ways without any problems.

> > My question, therefore, now becomes "will the application still run on
> > computers with Windows 2000, 98, or Me?"

> Yes, DirectX supports 2000, 98, Me, etc.  I've recently switched to XP for
> my development machince, have not had any problems with compatability.

> Cheers,

> --
> Eric DeBrosse
> http://www.blown.com/dx/
> Microsoft Visual Basic DirectX MVP

> The opinions expressed in this message are my own personal views and
> do not reflect the official views of Microsoft Corporation. The MVP
program
> does not constitute employment or contractual obligation with Microsoft.



Fri, 01 Oct 2004 04:27:53 GMT  
 
 [ 10 post ] 

 Relevant Pages 

1. What's the differance between a ActiveX.dll and regular dll's

2. I only downloaded th DirectX SDK which didn't contain documents on DirectX Media

3. ActiveX DLL events won't fire when DLL shows Modal Form

4. 'DoEvents' inside ActiveX DLL

5. ActiveX dll's and EXE's

6. Licensing for ActiveX DLL's and EXE's

7. Using the MDI Child property on GUI's gen'd by an ActiveX DLL

8. ActiveX dll's and EXE's

9. Adding VBA function to Visio's VBA Editor from ActiveX DLL

10. HELP: Can't get CLSID / GUID (classID) from ActiveX DLL or OCX

11. HELP: Can't get CLSID / GUID (classID) from ActiveX DLL or OCX

12. ActiveX DLL won't close from IE

 

 
Powered by phpBB® Forum Software