SiComponents Home Page SiComponents Forums
Here you will be able to get help and share your experience
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Migrating Legacy Custom Control DLL

 
Post new topic   Reply to topic    SiComponents Forums Forum Index -> Resource Builder
View previous topic :: View next topic  
Author Message
seek2fly



Joined: 13 Oct 2011
Posts: 2

PostPosted: Fri Oct 14, 2011 1:02 pm    Post subject: Migrating Legacy Custom Control DLL Reply with quote

I need to upgrade a custom control DLL (for which we have the source code) so that it is compatible with Resource Builder's Custom Control Dialog Editor.

Goal: Allow us to use Resource Builder for this DLL such that the available controls appear in the Custom Control Available Controls list in the Dialog Editor configuration screen and function similarly to the sample DLL.

In short: I need to add ListClasses and all related functions.

Issues: I know C/C++, can export functions but I do not have experience with resources. I need assistance to convert/link to the existing resource control code in the exiting DLL and do not know where to start.

Platform: Visual Studio 2005 and 2008, C/C++.

I have created and exported a ListClasses function.
I have created Info, Style and Flags functions with only contents for the Info functions.
The existing code has "CustomControlsInfoA" and supporting functions from which I derive my ListClasses code.
I need to be able to:
1) Debug my DLL when adding it to the Resource Builder. I need to see evidence that my ListClasses function is being called.
2) I need to know if there are requirements regarding shared memory/objects for Resource Builder to access the DLL functions.
3) Do I need specific ordinals
4) The DLL has to continue to function is the target applications as it currently does.

Any assistance to get us on the right track would be appreciated.

Help!
Thanks in advance!
Back to top
View user's profile Send private message
seek2fly



Joined: 13 Oct 2011
Posts: 2

PostPosted: Sun Oct 16, 2011 7:28 pm    Post subject: Calling convention Reply with quote

Progress relating to previous post:

I have constructed and tested ListClasses and Info functions using my own exe calling my resource DLL. Resource Builder succeeds at running ListClasses but appears to get Access Violations when calling the Info functions.

It appears I have one of two problems:
1) I am not respecting Resource Builder's calling convention for the Info functions as stored in the class list structures.
2) I am compiling with the wrong header files, thus conflicting with what Resource Builder expects.

Where can I get:
a) Calling convention / programming standards for Resource Builder (stdcall, cdecl)?
b) Where can I get the proper custcntl.h file to comply with what Resource Builder uses.

The custctrl.h file I am using comes from the Borland Resource Workshop from which the original DLL I am trying to port comes from.

Any help from anyone would be great. It I can't crack this we will need to ditch using Resource Builder and use a plan B as my allocated time has run out.

Thanks in advance!
M.
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2102

PostPosted: Mon Oct 17, 2011 11:04 am    Post subject: Reply with quote

Hello,

1. All functions shall be with stdcall calling convention.
2. All records should be packed. It means no padding in fields.
3. All char[] fields shall be ANSI chars (single byte) not Unicode (2 bytes).
4. The returned pointers to Info strectures shall point to memory allocated by GlobalAlloc() with GMEM_SHARE flag.
There is Pascal sample unit and project that implements custom controls library. You can always check it to find the differences (if any) with your code.
Hope this helps.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    SiComponents Forums Forum Index -> Resource Builder All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by p h p B B  © 2001, 2005 p h p B B  Group