Click here to Skip to main content
16,012,468 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionabout parameter passing Pin
savitri18-Mar-08 23:18
savitri18-Mar-08 23:18 
GeneralRe: about parameter passing Pin
CPallini19-Mar-08 0:30
mveCPallini19-Mar-08 0:30 
GeneralRe: about parameter passing Pin
savitri19-Mar-08 0:55
savitri19-Mar-08 0:55 
QuestionRe: about parameter passing Pin
CPallini19-Mar-08 1:03
mveCPallini19-Mar-08 1:03 
General[Message Deleted] Pin
savitri19-Mar-08 1:17
savitri19-Mar-08 1:17 
GeneralRe: about parameter passing Pin
Demian Panello19-Mar-08 1:44
Demian Panello19-Mar-08 1:44 
GeneralRe: about parameter passing Pin
savitri19-Mar-08 2:04
savitri19-Mar-08 2:04 
GeneralRe: about parameter passing Pin
CPallini19-Mar-08 2:06
mveCPallini19-Mar-08 2:06 
The problem is in your approach on passing strings that actually are OUT parameters.
As simple solution you may mimic WIN32 API GetWindowText behaviour, i.e. for each string that must be filled by the ActiveX control, pass the pointer of a buffer (allocated by the client) and the buffer size to the control.
A simple example:

ActiveX code
BOOL ReadBlk(LPSTR MemId, LONG MemIdSize)
{
  if ( !MemId || MemIdSize < 1)
    return FALSE;
  
  strncpy(MemId, "Hello Client!", MemIdSize-1);
  MemId[MemIdSize-1]='\0';
  return true;
}


Client code
const int SIZE=0x100;
CHAR MemId[SIZE];
m_ActiveX.ReadBlk((LPSTR) MemId, SIZE);


Smile | :)

If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.

This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke


GeneralRe: about parameter passing Pin
David Crow19-Mar-08 3:44
David Crow19-Mar-08 3:44 
GeneralRe: about parameter passing Pin
CPallini19-Mar-08 4:26
mveCPallini19-Mar-08 4:26 
GeneralRe: about parameter passing Pin
David Crow19-Mar-08 4:30
David Crow19-Mar-08 4:30 
GeneralRe: about parameter passing Pin
savitri19-Mar-08 19:45
savitri19-Mar-08 19:45 
QuestionRe: about parameter passing Pin
David Crow20-Mar-08 2:28
David Crow20-Mar-08 2:28 
AnswerRe: about parameter passing Pin
savitri20-Mar-08 21:17
savitri20-Mar-08 21:17 
GeneralRe: about parameter passing Pin
David Crow21-Mar-08 2:53
David Crow21-Mar-08 2:53 
Questionhow to pause execution on a form based application without Sleep() effect Pin
reteset18-Mar-08 23:07
reteset18-Mar-08 23:07 
GeneralRe: how to pause execution on a form based application without Sleep() effect Pin
Cedric Moonen18-Mar-08 23:10
Cedric Moonen18-Mar-08 23:10 
GeneralRe: how to pause execution on a form based application without Sleep() effect Pin
reteset18-Mar-08 23:32
reteset18-Mar-08 23:32 
GeneralRe: how to pause execution on a form based application without Sleep() effect Pin
Mark Salsbery19-Mar-08 8:41
Mark Salsbery19-Mar-08 8:41 
GeneralRe: how to pause execution on a form based application without Sleep() effect Pin
Randor 19-Mar-08 3:37
professional Randor 19-Mar-08 3:37 
GeneralRe: how to pause execution on a form based application without Sleep() effect Pin
ThatsAlok19-Mar-08 19:51
ThatsAlok19-Mar-08 19:51 
GeneralRe: how to pause execution on a form based application without Sleep() effect Pin
reteset21-Mar-08 7:40
reteset21-Mar-08 7:40 
GeneralModeless dialog box Pin
Chandrasekharan P18-Mar-08 22:57
Chandrasekharan P18-Mar-08 22:57 
GeneralRe: Modeless dialog box Pin
Cedric Moonen18-Mar-08 23:05
Cedric Moonen18-Mar-08 23:05 
GeneralRe: Modeless dialog box Pin
Chandrasekharan P18-Mar-08 23:20
Chandrasekharan P18-Mar-08 23:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.