ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

resbuf* and acedGetVar

2 REPLIES 2
Reply
Message 1 of 3
ZibiK
1313 Views, 2 Replies

resbuf* and acedGetVar

Hello,

 

could someone explain me why I have error in my sample code?:

 

struct resbuf* Wskaznik;

int OldOsnap = acedGetVar(_T("OSMODE"), &Wskaznik); // here is error

acutRelRb(Wskaznik);

 

Error 1 error C2664: 'acedGetVar' : cannot convert parameter 2 from 'resbuf **' to 'resbuf *'

 

I want to get system variable "OSMODE" and use it in other place in my code.

I declare OldOsnap: public: int OldOsnap;

 

Where I can found a good examples to use "resbuf"?

 

regards,

ZibiK

Tags (1)
2 REPLIES 2
Message 2 of 3
artc2
in reply to: ZibiK

The docs for acedGetVar() very clearly state that the second argument must be a pointer to an allocated resbuf.  In your code you are passing in the address of a pointer to resbuf.  You need to change:

 

struct resbuf* Wskaznik;

 

to this:

 

struct resbuf Wskaznik;

 

and get rid of the acutRelRb() call since your resbuf is now on the stack and will be freed automatically when it goes out of scope.

Message 3 of 3
ZibiK
in reply to: artc2

Thank's you artc2 for your help 😉

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost