POV-Ray : Newsgroups : povray.programming : GUI Extension Problem Server Time
29 Jul 2024 06:18:11 EDT (-0400)
  GUI Extension Problem (Message 1 to 4 of 4)  
From: Winefred Washington
Subject: GUI Extension Problem
Date: 1 Oct 1998 11:39:53
Message: <01bded45$92369960$ddaffbcc@wwashington>
Hi,

I'm trying to write a gui extension for POVRAY. I've gotten the example
code to work under VC5.0 EXCEPT for the About dialog. It appears the
DllEntryPoint is not being called. Since it's not, the hInstance is
uninitialized causing the call to create the dialog from the IDD_ABOUT
resource to fail. If I understand the LoadLibrary call, it's suppose to
call DllEntryPoint. I've tried adding the file to the .DEF, but no luck.

Also, does anyone know how to use the __declspec(dllexport) directive
instead of a separate DEF file?

Thanks in advance,
Winefred


Post a reply to this message

From: Ron Parker
Subject: Re: GUI Extension Problem
Date: 1 Oct 1998 12:32:22
Message: <3613a086.0@news.povray.org>
On 1 Oct 1998 10:39:53 -0500, Winefred Washington 
	<wwa### [at] compuservecom> wrote:
>I'm trying to write a gui extension for POVRAY. I've gotten the example
>code to work under VC5.0 EXCEPT for the About dialog. It appears the
>DllEntryPoint is not being called. Since it's not, the hInstance is
>uninitialized causing the call to create the dialog from the IDD_ABOUT
>resource to fail. If I understand the LoadLibrary call, it's suppose to
>call DllEntryPoint. I've tried adding the file to the .DEF, but no luck.

The default entry point has changed from DllEntryPoint to DLLMain.  

If you still want to use DllEntryPoint, you can specify the entry 
point in the Project settings box, under the Link tab in the Output 
category.  To get there, right-click on your project, select Settings, 
choose "All configurations" from the "Settings for" dropdown, pick the 
link tab, choose "Output" from the "Category" dropdown, and enter 
DllEntryPoint in the "Entry-point Symbol" box.

If you don't want to do that, or if it's easier to just rename your
entrypoint function, here is the new prototype:

BOOL WINAPI DLLMain( HINSTANCE hDLLInst, DWORD fdwReason, LPVOID lpReserved );

>Also, does anyone know how to use the __declspec(dllexport) directive
>instead of a separate DEF file?

Here's an example of a function declaration using declspec:

__declspec( dllexport ) void MyFunction( void )  

You'll want to do this in both the prototype and the actual definition of the
function.


Post a reply to this message

From: Winefred Washington
Subject: Re: GUI Extension Problem
Date: 1 Oct 1998 18:26:17
Message: <3613f379.0@news.povray.org>
Ron,

Thanks for your help. I changed the name and the procedure is now being
called.


Ron Parker wrote in message <3613a086.0@news.povray.org>...

>>Also, does anyone know how to use the __declspec(dllexport) directive
>>instead of a separate DEF file?
>
>Here's an example of a function declaration using declspec:
>
>__declspec( dllexport ) void MyFunction( void )
>
>You'll want to do this in both the prototype and the actual definition of
the
>function.
>
I tried using the declspec shown below:

__declspec(dllexport) DWORD WINAPI PovGuiExtensionGetPointers (int RecSize,
GuiPointerBlock *PointerBlock)

but I get the Init message failure because PovRay cannot find the address of
PovGuiGetPointer routine. The guidemo file
does not have the routine prototyped.

Winefred


Post a reply to this message

From: Ronald L  Parker
Subject: Re: GUI Extension Problem
Date: 1 Oct 1998 20:42:28
Message: <361511b7.67999000@news.povray.org>
On Thu, 1 Oct 1998 16:27:10 -0500, "Winefred Washington"
<wwa### [at] compuservecom> wrote:

>I tried using the declspec shown below:
>
>__declspec(dllexport) DWORD WINAPI PovGuiExtensionGetPointers (int RecSize,
>GuiPointerBlock *PointerBlock)
>
>but I get the Init message failure because PovRay cannot find the address of
>PovGuiGetPointer routine. The guidemo file
>does not have the routine prototyped.

Which is it?  PovGuiGetPointer or PovGuiExtensionGetPointers?  I'm
guessing it's the longer one and you just didn't want to type it
twice.

One thing that can make a difference is the parameter-passing 
scheme that you're using.  WINAPI is different from cdecl or 
fastcall.  Maybe you should drop the WINAPI and see if it 
helps, though I suspect that since POV looks up the routine by 
name, your best bet is to just continue using the def file.
Your compiler is likely to "mangle" the name by putting an
underscore on the front of it.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.