|
Sorry, but i am confused. Theres no where any .exe to be found. I'm not sure what you ment by :
"Just use the browse option and choose the executable that will be loading and using this library"
Don't i need to create the .exe?
|
|
|
|
|
blokkies wrote: Don't i need to create the .exe?
If you don't have any exe that uses your dll yet, yes you have to create one. You dll can't be used alone, it should be loaded by an executable.
But what is your problem exactly ? Because if you are able to create a dll, creating an executable shouldn't be too difficult...
|
|
|
|
|
my problem is that I am not able to debug my program? When 'n hit F5 it asks me for an executable. When 'n go build, the only option is to build the .dll. Other program that i am working on has an .exe that they use to debug the code. How do I create an .exe for this new project?
Please beer in mind that i am not a C++ programmer but SAS,RPG and SQL.
|
|
|
|
|
blokkies wrote: How do I create an .exe for this new project?
In the same way that you created the DLL, except that you select Application instead of DLL (or Library). What version of VS are you using?
"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
|
|
|
|
|
I am using Visual C++ 6.0. I created only one MFC AppWizard(dll) project. On the Build option i can only choose Build XXX.dll (F7).
Thanks.
|
|
|
|
|
blokkies wrote: I am using Visual C++ 6.0.
File --> New --> Projects
"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 wrote: Please beer in mind that i am not a C++ programmer but SAS,RPG and SQL.
Then it's gonna be really complicated to explain what you have to do. Because you'll need not only to create the executable but also add some code inside it to load the dll and call the functions you want to debug.
But if you are not a C++ programmer, why are you developping a DLL ? It seems a bit crazy that you start with that instead of learning the basis (learn the language, create a simple app, ...)
|
|
|
|
|
I agree, but i am just the employee. I have been doing maintenance on existing C++ systems with little problems. Maybe that’s why. But it is something different to start from scratch. I really wanted to get this right.
Thanks for the help.
|
|
|
|
|
Can you just tell me how do i create the Executable?
|
|
|
|
|
You've already been told...at least twice. What more do you require? If you are not going to heed our suggestions, stop asking for help.
"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
|
|
|
|
|
People already told you how to do that (David for instance). But, then ? You will end up an executable that doesn't do anything with the dll and there's no point in that. You will need to add code to load the dll and call some functions but in order for us to help you, you'll need to learn at least the basics of C++ and visual studio.
You think creating an executable is just a matter of clicking there and there and BAM, magically your executable doing what you want is created ?
|
|
|
|
|
To be fair, he might be working with a VB executable
|
|
|
|
|
It depends because it could even complicate things a lot (for instance if he needs to pass strings or objects to a dll function).
|
|
|
|
|
Cedric Moonen wrote: You think creating an executable is just a matter of clicking there and there and BAM, magically your executable doing what you want is created ?
That's what my (non-programming) colleagues tell me!
Iain.
In the process of moving to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job!
|
|
|
|
|
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
|
|
|
|