Antwort: Re: [aspectc-user] (no subject)

Matthias.Ritter at metop.de Matthias.Ritter at metop.de
Tue Mar 10 13:10:20 CET 2009


Hello,

thanks for this idea but i already tried to cast it.
After the explicit casting the error-message switches to 
"'overload-function' can't be converted into 'LPTHRAD_START_ROUTINE'"
and it cant be found the right function cause of wrong types.

kind regards
Matthias Ritter


>Hello,
>
>> I'm programming an analysing tool for c++ code.
>> I'm using the AspectC++ Add-In for Visual Studio .NET (2003).
>> I tried to weave a thread into the application, starting before the 
>> main-function is executed.
>> The code looks like this:
>> 
>> DWORD bar(void* param)
>>                 {
>>                         // do something
>>                         return 0;
>>                 }
>> 
>> advice Main() : before()
>>         {
>>                 myThread = CreateThread( NULL, 0, bar, 
(void*)&ThreadArgs, 
>> 0, (LPDWORD)&myThreadId );
>>         }
>> 
>> Unfortunately the Aspectc++ compiler fails cause he wants to convert 
the 
>> third parameter from 'DWORD (void*)' into 'LPTHREAD_START_ROUTINE' !
>
>I can not reproduce it with the current development version of ac++. A
>work-around is to explicitly cast bar to LPTHREAD_START_ROUTINE (just
>like everywhere in the VC++ system headers):
>
>myThread = CreateThread( NULL, 0, (LPTHREAD_START_ROUTINE)bar, ...
>
>Regards,
>Matthias
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.aspectc.org/pipermail/aspectc-user/attachments/20090310/bef045e2/attachment.html>


More information about the aspectc-user mailing list