views:

67

answers:

1

Hi guys i have a bit of a problem with a few classes, and i would be very grateful if someone can help me out. So i have:

  1. Already compiled executable (for whom i don't have the source)
  2. A class in that program that i want to call

The program doesn't have export for the class, and that's my problem i don't have definition for this class, so is there a way to get a callback to this class?

Example: In the compiled executable:

foo::bar (example) { printf(example); }

My app:

CALLBACK(foo::bar, "this text must be passed as argument")

Or in other words i want to call a class in other executable (without having its source) and pass arguments to its function.

A: 

if your executable(application ) can take that argument as command line argument you can call that application with command line argument as that parameter

for example in win32 API

LPTSTR szCmdline = _tcsdup(TEXT("C:\\Program Files\\MyApp -L -S"));
    CreateProcess(NULL, szCmdline, /* ... */);

That is at max you can do with any application... -L and -S will pass as argument to MyApp

mihirpmehta