Problem with routine!
[1/7] from: amicom::sonic::net at: 9-Mar-2005 4:44
OK. I finally made some progress on my video capture .dll stuff, but I'm
stuck again. Here is the C++ code that works properly calling the routine
grabframe
:
char *pFrame = NULL;
long frameSize;
HANDLE h;
char *fn = new char[256];
char *pTyped;
long frameSizeTyped;
DWORD bytesWritten;
LPDWORD pBytesWritten = &bytesWritten;
pFrame = grabFrame("This is me", &frameSize);
I think this can safely be whittled down to the following for this example:
char *pFrame = NULL;
long frameSize;
pFrame = grabFrame("This is me", &frameSize);
Here is my grabframe routine in Rebol:
grabframe: make routine! [
"Grab a video frame"
t1 [string!]
addr [integer!]
return: [string!]
] tfcapture "grabFrame"
If I try to call it with the following, Windows says Rebol generated an
illegal operation:
adrs: 0
res: grabframe "Test" adrs
Here is the grabframe declaration in the .h file if this helps any:
extern "C" __declspec(dllexport) char *grabFrame(CString, long *);
Any ideas you can give would be greatly appreciated!
-Bo
[2/7] from: jca::miranda::gmail::com at: 9-Mar-2005 14:47
what happens if you use this :
res: grabframe "Test" my-int: make struct! [p [integer!]]
Does it work better?
Not sure this is your problem, but well, just trying to guess. :)
@+
Bouba
On Wed, 09 Mar 2005 04:44:48 -0800, Bohdan or Rosemary Lechnowsky
<[amicom--sonic--net]> wrote:
[3/7] from: jca:miranda::gmail at: 9-Mar-2005 15:37
woops I made a mistake : u should have read :
res: grabframe "Test" my-int: make struct! [p [integer!]] none
Sorry.
On Wed, 9 Mar 2005 14:47:14 +0100, bouba <[jca--miranda--gmail--com]> wrote:
[4/7] from: amicom:sonic at: 9-Mar-2005 9:11
OK, changed to this:
grabframe: make routine! [
"Grab a video frame"
t1 [string!]
addr [struct! [i [integer!]]]
return: [string!]
] tfcapture "grabFrame"
a: make struct! [i [integer!]] none
grabframe "This is me" a
Same problem with the message "Rebol has generated errors"
Any other ideas?
-Bo
At 06:37 AM 3/9/2005, you wrote:
[5/7] from: volker::nitsch::gmail::com at: 9-Mar-2005 18:36
On Wed, 09 Mar 2005 04:44:48 -0800, Bohdan or Rosemary Lechnowsky
<[amicom--sonic--net]> wrote:
> OK. I finally made some progress on my video capture .dll stuff, but I'm
> stuck again. Here is the C++ code that works properly calling the routine
<<quoted lines omitted: 25>>
> Here is the grabframe declaration in the .h file if this helps any:
> extern "C" __declspec(dllexport) char *grabFrame(CString, long *);
What is a CString? Is it a MS-class with pointer, length and such
stuff, not just a char* ? Can you look into that from a c-debugger?
> Any ideas you can give would be greatly appreciated!
> -Bo
<<quoted lines omitted: 5>>
> To unsubscribe from the list, just send an email to
> lists at rebol.com with unsubscribe as the subject.
--
-Volker
Any problem in computer science can be solved with another layer of
indirection. But that usually will create another problem.
David
Wheeler
[6/7] from: SQLAB::gmx::net at: 10-Mar-2005 10:06
What happens if you do change it to
grabframe: make routine! [
"Grab a video frame"
t1 [string!]
addr [struct! [i [integer!]]]
return: [integer!]
] tfcapture "grabFrame"
a: make struct! [i [integer!]] none
grabframe "This is me" a 1
?
AR
Bohdan or Rosemary Lechnowsky wrote:
[7/7] from: robert::muench::robertmuench::de at: 10-Mar-2005 19:01
On Wed, 09 Mar 2005 09:11:14 -0800, Bohdan or Rosemary Lechnowsky
<[amicom--sonic--net]> wrote:
> Same problem with the message "Rebol has generated errors"
Sounds like the write-back is the problem. The routine will change the
framesize parameter and I expect, that the Rebol parameter can't be
written too (which indicates that you are not calling the C function
with the address of the variable taking the result). Maybe I'm not
telling something new... Robert
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted