|
Can't you just create a "dummy" Win32 project that links to your DLL?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
blokkies, let me try to summarize what's going on
What is a DLL?
A DLL is a block of useful code that can be loaded by several programs at once
Why would I make one?
Because you want a modular solution. A reusable, easy to update solution.
What is a DLL again??
It is something that one or several actual programs might find useful. It is not a program by itself. You could think of it as a class, if you really wanted to.
What's a program?
... Well a program is a block of code that a human might find useful.
So a DLL is not a program?
Correct :)
So humans use programs, and programs use DLLs?
Right again!
|
|
|
|
|
Is your project used in the program? You say that you're doing mainainance, right? In this case the code you want to debug is already used in your program.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Hello everyone .
i am trying to import a COM file in vc++ project but the generated .tlh file from the com file seems to have an inherit errors , i successfully added #import directive in my stdafx.h file with the full phyiscal path to my com file then i included stdafx.h into my stdafx.cpp file , then i compile
the studio generates for me a .tlh file but that file seems to have errors in it .
the following code in the generated .tlh file has the problem
<br />
struct __declspec(uuid("92d8ec9e-550e-4525-a858-c8601ad50703"))<br />
_VoiceNumbers : IDispatch<br />
{<br />
<br />
<big>__declspec(property(get=GetVoiceNumbers))<br />
_CollectionPtr VoiceNumbers;</big><br />
<br />
<br />
long Count ( );<br />
HRESULT Delete (<br />
long Index );<br />
HRESULT Add (<br />
struct _PhoneNumber * oAdd );<br />
_PhoneNumberPtr Item (<br />
long Index );<br />
IUnknownPtr NewEnum ( );<br />
_CollectionPtr GetVoiceNumbers ( );<br />
<br />
<br />
virtual HRESULT __stdcall raw_Count (<br />
long * _arg1 ) = 0;<br />
virtual HRESULT __stdcall raw_Delete (<br />
long Index ) = 0;<br />
virtual HRESULT __stdcall raw_Add (<br />
struct _PhoneNumber * oAdd ) = 0;<br />
virtual HRESULT __stdcall raw_Item (<br />
long Index,<br />
struct _PhoneNumber * * _arg2 ) = 0;<br />
virtual HRESULT __stdcall raw_NewEnum (<br />
struct IUnknown * * _arg1 ) = 0;<br />
virtual HRESULT __stdcall get_VoiceNumbers (<br />
struct _Collection * * _arg1 ) = 0;<br />
};<br />
the bolded code part has the problem and the following errors are
<br />
Error 1 error C2146: syntax error : missing ';' before identifier 'VoiceNumbers' d:\hitech work\jniwork\testingrex\testingrex\debug\resumemirror.tlh 893 TestingRex<br />
Error 2 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\hitech work\jniwork\testingrex\testingrex\debug\resumemirror.tlh 893 TestingRex<br />
Error 3 error C2208: 'ResumeMirror::VoiceNumbers' : no members defined using this type d:\hitech work\jniwork\testingrex\testingrex\debug\resumemirror.tlh 893 TestingRex<br />
Error 4 fatal error C1903: unable to recover from previous error(s); stopping compilation d:\hitech work\jniwork\testingrex\testingrex\debug\resumemirror.tlh 893 TestingRex<br />
<br />
i am trying to make a wrapper for that com file to be able to call it from java using JNI technology .
each time i try to solve the errors , and compile again the studio generates for me another .tlh file as earlier one that has the same errors and i don't know what to do .
anyone has any solution for that please
Human knowledge belongs to the world.
|
|
|
|
|
Sounds like it has dependencies on another COM object.
Try adding 'auto_search' to your #import statement - that will attempt to resolve dependencies such as this without you having to alter your code by implicitly importing the other libraries that are required:
#import "some-comm-item" auto_search
HTH!
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
i did that but it gives me the following errors
Error 1 error C2059: syntax error : '(' d:\hitech work\jniwork\testingrexx\testingrexx\debug\msvbvm60.tlh 483 TestingRexX
Error 2 error C2059: syntax error : '(' d:\hitech work\jniwork\testingrexx\testingrexx\debug\msvbvm60.tlh 925 TestingRexX
Error 3 error C2059: syntax error : '<L_TYPE_raw>' d:\hitech work\jniwork\testingrexx\testingrexx\debug\msado27.tlh 2380 TestingRexX
Error 4 error C2238: unexpected token(s) preceding ';' d:\hitech work\jniwork\testingrexx\testingrexx\debug\msado27.tlh 2380 TestingRexX
Human knowledge belongs to the world.
|
|
|
|
|
Well - that tells you where the CollectionPtr comes from - it's a VB thing. OK, in that case you can explicitly define CollectionPtr yourself (look at how it's defined in the msvbvm60.tlh file) and remove the auto_search from the #import statement.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
please my friend , can you explain in more detail i am not c++ savvy
be patient please with me
i searched that file but i didn't find _CollectionPtr
i found that
struct __declspec(uuid("a4c46780-499f-101b-bb78-00aa00383cbb"))
_Collection : IDispatch
{
//
// Wrapper methods for error-handling
//
_variant_t Item (
VARIANT * Index );
HRESULT Add (
VARIANT * Item,
VARIANT * Key = &vtMissing,
VARIANT * Before = &vtMissing,
VARIANT * After = &vtMissing );
long Count ( );
HRESULT Remove (
VARIANT * Index );
IUnknownPtr _NewEnum ( );
//
// Raw methods provided by interface
//
virtual HRESULT __stdcall raw_Item (
/*[in]*/ VARIANT * Index,
/*[out,retval]*/ VARIANT * pvarRet ) = 0;
virtual HRESULT __stdcall raw_Add (
/*[in]*/ VARIANT * Item,
/*[in]*/ VARIANT * Key = &vtMissing,
/*[in]*/ VARIANT * Before = &vtMissing,
/*[in]*/ VARIANT * After = &vtMissing ) = 0;
virtual HRESULT __stdcall raw_Count (
/*[out,retval]*/ long * pi4 ) = 0;
virtual HRESULT __stdcall raw_Remove (
/*[in]*/ VARIANT * Index ) = 0;
virtual HRESULT __stdcall raw__NewEnum (
/*[out,retval]*/ IUnknown * * ppunk ) = 0;
};
Human knowledge belongs to the world.
|
|
|
|
|
snouto wrote: i searched that file but i didn't find _CollectionPtr
You won't find that explicitly. You'll find something like COM_SMARTPTR_TYPEDEF(_Collection, __uuidof(_Collection));
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
how can i redefine explicitly that struct my friend , i don't get you well
Human knowledge belongs to the world.
|
|
|
|
|
Don't be so fscking impatient - you'll find it just irritates the people who are trying to help you.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
i am sorry my friend , i found that
struct __declspec(uuid("a4c4671c-499f-101b-bb78-00aa00383cbb"))
Collection;
and that
_COM_SMARTPTR_TYPEDEF(_Collection, __uuidof(_Collection));
so what can i do by this thing now
Human knowledge belongs to the world.
|
|
|
|
|
Put these two lines:
struct __declspec(uuid("a4c4671c-499f-101b-bb78-00aa00383cbb"))
Collection;
_COM_SMARTPTR_TYPEDEF(_Collection, __uuidof(_Collection));
in your .cpp file before the #import line.
You probably need the definition (as opposed to declaration of _Collection as well - is there another definition of _Collection later in the tlh file, or in the tli file? If so - you need that
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Where can i put that line my friend
?
_COM_SMARTPTR_TYPEDEF(_Collection, __uuidof(_Collection));
in Resumemirror.tlh
just before the line with the error or where exactly ????
Human knowledge belongs to the world.
|
|
|
|
|
stuart please give me a full solution , i don't get you well my friend
Human knowledge belongs to the world.
|
|
|
|
|
I had the same problem importing msado15.dll,
a solution was found on some Chinese forum[^], adding rename("EOF", "adoEOF") on the end of the import statement line
for example,
#import "c:\program files\common files\system\ado\msado15.dll" no_namespace rename("EOF", "adoEOF")
In my case the error was raised on a line inside msado15.tlh with folowing code
__declspec(property(get=GetEOF))
VARIANT_BOOL EOF;
So i suppose the conflict was on EOF being defined multiple times, and the rename solves this.
HTH,...
|
|
|
|
|
Yes, I discovered that was the root cause as well - it was the same issue with the VB run-time - it defines EOF as well. I'd have found that out if I'd made a little sample app (as I often do), but as I do not have (and, given the opportunity, will never have) VB6 on my machine, I thought I wouldn't be able to import the VB6 run-time. I must confess that I decided not to post this alternate solution, as the OP seemed...satisfied, and I don't like adding confusion
Thanks for your post, anyway!
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Now i'm confused
|
|
|
|
|
I worked out that renaming things in the #import was the right solution (rather than the hack I suggested) well after my previous posts in this thread - that's why I didn't re-post and suggest it.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Looking for a program that will search through a large amount of folders and sub folders and pick out certain information from .mat files in each.
Once the information has been pulled from the .mat files, be it the start time of the data processing, I would like the program to start building an array with the extracted information.
Any ideas??
I am able to extract the information that I want when I look for it directly in one specific .mat file but I cannot figure out how to set the program up to run through many folders and build a table of the extracted information.
HELP :/
Thanks in advance,
Martin
|
|
|
|
|
This article[^] has code that will search through folders and sub-folders for files - you could modify that to tell you all the .mat files, which you can then process.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I want to develope a real time data server client like excel sheet . how it is possible
Trioum
|
|
|
|
|
trioum wrote: I want to develope a real time data server client like excel sheet . how it is possible
Depending on how you ask questions I very much doubt it is possible at all.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
I would start with printf("hello world\n"); and then gradually progress.
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
[My articles]
|
|
|
|
|
can you run that by me again? did you want a server or a client?
|
|
|
|