Thanks for all your help everyone!!!!!
I've got it!!!!!!!!!
I'm not sure why the dll methods were crashing out, but I rebuilt the dll and it is all working!
Type: Posts; User: Deb
Thanks for all your help everyone!!!!!
I've got it!!!!!!!!!
I'm not sure why the dll methods were crashing out, but I rebuilt the dll and it is all working!
I would like to use a method written in another c file that I have.
How would I do this?
Rellocating ....
From the JNI method... I called initDLL(), loading the dll and functions...
then I called the getOutputFile(), which completes, and on the return from getOutputFile() to the JNI...
After trying to figure out my nice error... I came up with this...
The dll is loaded, the GetProcAddress(....) returns okay. I check for a NULL return from the GetProcAddress(....)
//... ...
Thanks.
Wasn't sure if I need to add the source == NULL or destination == NULL after using free(), but figured it wouldn't hurt.
I don't mind removing extra lines either. :o)
I'm getting...
Reading about realloc() now... I used malloc() and free() not realloc().
Is there really a difference which way I do it? Do they both produce the same results?
I'm crashing out ... Instead of pieces, here's the chunk of it. Please help.... :)
I have a function that I call from Java ... It initializes the DLL, returns if that fails, otherwise calls the...
char *destination = NULL;
copy(&destination, source);
I believe that is what I want.
I have quite a few functions that I don't want to keep assigning variables to.
Seems so much easier to...
I read that link thanks..
I'm still having issues...
If I use malloc in the function, I should clean it up when I leave that
function.
I don't need the char* for anything else. I'm done...
What am I doing wrong?
I had:
void copy(char* destination, const char* source)
{
int length;
if (!source)
Sorry, my bad for typing the wrong name ...
The dll function call is not the same as the function call.
Yes, the dll function call does not return with a value to indicate that it has...
The dll function is being called, takes an input.xxx and creates an output.xxx which I need send back around for each ext.
void createOutputFile()
{
int errorCode;
int index = 0;
...
Timers...
I have a call to a dll function which creates an output.txt file.
I need to use that file afterwards, but have no way to know how long it is going to take to create the file. The...
So simple of a name. :) Thanks.
Is there a way to rename a file? I see create/open/delete/write ... etc
So checking for malloc to have done something means two things to me:
1. Either set the char* name = NULL
And then the
if (!name) { } will fail if malloc didn't do it's job.
Is...
Thanks everyone for helping... another question though.
I have:
char* name = malloc(CHAR_BUFFER_SIZE);
if (name)
{
// do whatever I need
Just a little clarification, please:
If I use malloc, where CHAR_BUFFER_SIZE is previously defined to 256, for example:
char* name = (char *)malloc(CHAR_BUFFER_SIZE);
I need to free it...
The c code contains a load dll method. Loads the unzip32.dll
The method I wrote was to call the dll function to extract the zip entries from the specified zip file name.
Takes the file name,...
Hmm.... not sure of the term to use I guess.
What I am trying to do is to access methods in a dll from Java (using JNI).
I can call native methods, ie: isZipFile(.... ) extractZip(.... ). ...
I have created a dll that contains a couple of methods, one is to check a zip file to see if the entries match criteria. Another method extracts the entries.... and so on.
There other methods...
Hmm... it appears to be working now. :o) Thanks for all your help!!!!!
Thank you!!!
That works when testing in C -- but when I call it from the JNI method, it crashes out if I don't copy it.
Any idea why?
I just have the dll and a few files that I created the dll from. I don't have all of them.
Switching computer, years ago, blah, blah, and I apparently didn't copy the entire
directory.
I'll...
If I understand you right .. the buffer would become invalid.
Okay, makes sense...
I need the value to stick around for a few other functions.
If I return the pointer, created by copyTCHAR,...