Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DLL Talk / Problem with my DLL

Author
Message
Iain
20
Years of Service
User Offline
Joined: 17th Jun 2004
Location: UK
Posted: 8th Nov 2004 23:01
Hi, im writing a DLL with a number of functions in it, the problem is that i am trying to get it to display a menu that i wrote in c++ and is saved in a resource file in my DLL, i want it to display the menu in the window when i launch the program i am writing in DBpro, i think it doesnt display it becouse i dont know what the handle of the DB window is, if someone could give me a small code snippet of how to get the DB windows handle and how to get it to display my menu it would be appreciated.

Thanks.

Iain
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 8th Nov 2004 23:48
What you need to do is use SetWindowLong to point to your own messaging loop, where you can then display any messages and what-not.

Unfortunately the only code I've got, that sort of shows it, puts on icon in the system tray and not menu.

Walk softly... and carry a big gun...
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 9th Nov 2004 00:23
Assuming you have the code in place to get hold of the DBPro core pointer ...



Then you can get the DBPro window handle by doing this ...



I can't help with the menu code - I understand the way it is done, but I've never had a need to actually write the code that does it.

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++ http://www.matrix1.demon.co.uk
Iain
20
Years of Service
User Offline
Joined: 17th Jun 2004
Location: UK
Posted: 9th Nov 2004 01:42 Edited at: 9th Nov 2004 01:49
Thanks guys, i am now able to get my program to display a menu bar and i can add main menu items to it, i am now trying to get it to add sub menu items, for example a quit option in the file menu.

This is a bit different to how i was doing it before, i was trying to load a menu from a resource file but i am now making functions in my DLL to allow me to make and edit the menu from DBpro, i think this will be better as i will be able to use it in more programs i write in DB.

Thnaks.
Iain
20
Years of Service
User Offline
Joined: 17th Jun 2004
Location: UK
Posted: 9th Nov 2004 02:59
I am having a bit of trouble adding sub menu items, does anyone know how to add sub menu items to a menu in c++, any help would be appreciated.

Thanks.
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 10th Nov 2004 03:33 Edited at: 10th Nov 2004 03:34
AppendMenu or InsertMenu, whichever you prefer really.



Pretty Snazzy, eh? Just got to remember the order in which your adding things else you end up with a mess


Iain
20
Years of Service
User Offline
Joined: 17th Jun 2004
Location: UK
Posted: 10th Nov 2004 03:36 Edited at: 10th Nov 2004 06:13
Thanks Raven, thats great.
I see where i was going wrong now.

If you would be able to tell me how that is written in c++, that would be great.

Thanks.
Ianhfar
20
Years of Service
User Offline
Joined: 8th Jul 2004
Location: UK
Posted: 11th Nov 2004 23:24
Iain

This is straight out of msdn
Ianhfar
20
Years of Service
User Offline
Joined: 8th Jul 2004
Location: UK
Posted: 11th Nov 2004 23:26
Oh
and insert and create
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 12th Nov 2004 02:43
i do believe i told him of InsertMenu, the reason I didn't write an example of that, is because it is a pain in the ass working around a Structure Class in order to create something new.

you have to type, declare then fill. AppendMenu you simply add what you need to.

It's an older method, but easier and quicker to show working with less that can go wrong.


Login to post a reply

Server time is: 2024-11-23 09:56:19
Your offset time is: 2024-11-23 09:56:19