Reply

callback in a c++ addin

[ Edited ]

 

hi all,

for my project i need a kind of callback which is triggered all the time the screen is refreshed or at least as fast as possible.

c++ code is the best implementation, but the method is what i am looking for.

thanks very much for any advice!

michele

 

Posted by: michele Fiorentino
Post date: 11/21/2007 4:08:22 AM

9 REPLIES

RE: callback in a c++ addin

[ Edited ]

 

Michele,

I am not near a development machine at the moment so I'll be going off memory.

If you have not done so already, download and install my VC++ VS.NET 2005 addin templates.  Once you have created an addin with the templates, there should be a #DEFINE in stdafx.h relating to view events that you can enable.

That's the best that I can give you at the moment.  I'm on Thanksgiving holiday break and away from my development machine.  Let me know if you need anything else.

 

Posted by: Jason Newell
Post date: 11/21/2007 4:42:43 AM

RE: callback in a c++ addin

[ Edited ]

 

Hi Michele,

try using the ApplicationWindowsEvents' WindowProc method. In this filter for the WM_PAINT message, this is fired everytime Solid Edge redraws an area of the screen.

Let me know if you need an example.

Cheers

Calum

 

Posted by: Calum McLellan
Post date: 11/21/2007 6:20:19 AM

RE: callback in a c++ addin

[ Edited ]

thans for the fast answers,

well i am pretty new with the framework, so a working example will be very handy...

i am wondering if is stable or i need something like a callback or a timer callback..

thanks

 

Posted by: michele Fiorentino
Post date: 11/21/2007 8:28:43 AM

RE: callback in a c++ addin

[ Edited ]

Ok, I'm back.

 

Calum, you do not get WM_PAINT messages for GL windows. You have to be hooked into the GL subsystem to get what you need. Solid Edge loosely gives you access via ViewEvents, DisplayEvents & GLDisplayEvents events.

 

Like I said previously, download my VS.NET 2005 templates and run the addin wizard. Open stdafx.h and un-remark:

 

#ifdef SE_ADDIN_MODELVIEW

 

Then go to ModelView.cpp and put breakpoints in the various event handlers.

 

 

 

Posted by: Jason Newell
Post date: 11/25/2007 5:02:07 PM

RE: callback in a c++ addin

[ Edited ]

Hi Jason,

well there you go - learn something new every day Smiley Wink

I actually thought I'd done this before and was just about to throw something together but you've probably just saved me a lot of frustration - thanks. I guess I got confused with the WM_COMMAND message...

Cheers

Calum

 

Posted by: Calum McLellan
Post date: 11/26/2007 8:48:29 PM

RE: callback in a c++ addin

[ Edited ]

I actually figured out how to hook into OpenGL last night. Works very much like a game hack. So now I have code that gets called when wglSwapBuffers gets called. It's like Man-in-the-middle_attack

 

Posted by: Jason Newell
Post date: 11/28/2007 3:43:22 AM

RE: callback in a c++ addin

[ Edited ]

 

Nice work man , got any sample code?

 

Posted by: Calum McLellan
Post date: 12/1/2007 8:48:09 AM

RE: callback in a c++ addin

[ Edited ]

 

LOL!

 

Part of my code was based off this http://research.microsoft.com/sn/detours. I checked into getting the Professional license in case I wanted to release an addin or something. $10,000 USD!!!! 

 

Guess I don't have a solution .  I'll have to scoure the hacker sites for some good source.

 

Posted by: Jason Newell
Post date: 12/1/2007 8:56:56 AM

RE: callback in a c++ addin

[ Edited ]

 

Little bit pricey eh

 

Posted by: Calum McLellan
Post date: 12/1/2007 9:06:18 AM