Author Topic: Porting old macro to VS 2009  (Read 3486 times)

murali

  • Community Member
  • Posts: 31
  • Hero Points: 0
Porting old macro to VS 2009
« on: June 18, 2009, 06:07:14 pm »
I have a macro that works just fine with VS 12.

However, when I upgraded to VS 2009, the same macro threw this warning. However it seems to load after a couple of times..

Module <my macro> contains a call to '_tbAddForm' with an uninitialized variable. Declare a function prototype to find the error at compile time.

I dont understand how to go about creating a function prototype for this. Also I saw that there is a Macro Debugger, but there seems to be no info on how to invoke it on my Macro.

Any pointers to resolve this error would be great.

thanks,
Murali

chrisant

  • Senior Community Member
  • Posts: 1410
  • Hero Points: 131
Re: Porting old macro to VS 2009
« Reply #1 on: June 19, 2009, 01:18:28 am »
I have a macro that works just fine with VS 12.
However, when I upgraded to VS 2009, the same macro threw this warning. However it seems to load after a couple of times..

Module <my macro> contains a call to '_tbAddForm' with an uninitialized variable. Declare a function prototype to find the error at compile time.

I dont understand how to go about creating a function prototype for this.
That does seem cryptic, especially without being able to see your code.
Perhaps if you post the code, it would be easier to offer a suggestion.


Also I saw that there is a Macro Debugger, but there seems to be no info on how to invoke it on my Macro.
Similar to if you were debugging a program:
1.  Use the Macro|Start Slick-C Debugger... command to start the debugger.
2.  In the debugger, set a breakpoint at the point where you want to start debugging.
3.  In the main SE window, invoke your macro.
When the breakpoint is reached, the macro will break into the Slick-C debugger.

murali

  • Community Member
  • Posts: 31
  • Hero Points: 0
Re: Porting old macro to VS 2009
« Reply #2 on: July 19, 2009, 03:05:12 am »
Here is the sample code that gives me that warning:
Code: [Select]
/*******************************************************************************
 * Include files
 ******************************************************************************/
#include "slick.sh"
#include 'tagsdb.sh'

/************************************
 * Globals
 *******************************************/

_form _tbSample_form {
   p_backcolor=0x80000005;
   p_border_style=BDS_SIZABLE;
   p_caption='Sample';
   p_CaptionClick=true;
   p_clip_controls=false;
   p_forecolor=0x80000008;
   p_height=105;
   p_tool_window=true;
   p_width=2040;
   p_x=17040;
   p_y=0;
   p_eventtab2=_toolbar_etab2;
   _image  {
      p_auto_size=true;
      p_backcolor=0x80000005;
      p_border_style=BDS_NONE;
      p_forecolor=0x80000008;
      p_height=405;
      p_max_click=MC_SINGLE;
      p_message='Sample Command';
      p_command='Sample_Cmd';
      p_Nofstates=2;
      p_picture='test.ico';
      p_stretch=false;
      p_style=PSPIC_HIGHLIGHTED_BUTTON;
      p_tab_index=5;
      p_value=0;
      p_width=405;
      p_x=1605;
      p_y=45;
      p_eventtab2=_ul2_picture;
   }

}


/*

Function Name : definit
Description : Main Entry function to this macro
*/
definit()
{
   //does nothing..
}

/*

Function Name : definit
Description : Main Entry function to this macro
*/

defload()
{       
   wid = _tbIsVisible("_tbSample_form");
   if (wid) {
      tbClose(wid);
   }
   _tbAddForm("_tbSample_form",1,true,BBSIDE_TOP,true);
   dock("_tbSample_form",BBSIDE_TOP);

}

Also Running the debugger and trying to load the module with the breakpoint set inside defload didnt work.

thanks for your help,
Murali

murali

  • Community Member
  • Posts: 31
  • Hero Points: 0
Re: Porting old macro to VS 2009
« Reply #3 on: July 19, 2009, 06:01:06 am »
including toolbar.sh solved the problem..

thanks,
Murali