|
its the objidl.idl file, taken from the platform SDK Folder in VS.net.
I'm moving the post to the COM forum.
My bad.
Cata
|
|
|
|
|
This is not C# any more, move to the COM forums. ANyways, you are getting that error because your command enviroment is not setup correctly.
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
Which is why I've been trying to get Catalyst to understand that in a separate thread. I mean, if you can't even understand environment variables, why would anyway think to tackle COM? That's like trying to climb Everest or K2 without making it up the front steps to the lobby (if it has one?)!
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Just run the vcvars32.bat found in "Microsoft Visual Studio .NET 2003\Vc7\bin" in the command line before trying to run MIDL
|
|
|
|
|
I'd like to use the TlbImp.exe program to build some managed COM objects. This seems to be the most efficient way of doing things.
The problem I have is that, what I am looking for resides in the objidl header file. DOesn't this compile to a DLL?
While there are many type libraries, I do not know which one would contain the data I need, if any. Which would it be?
If they are not located there, How do i extract data from an unmanaged DLL?
Cheers
Cata
|
|
|
|
|
Sorry, little more information here.
This relates to my Drag Drop problem. Basicaly, I'm looking for the COM classes used for the process to convert them into managed times. I'm not even sure I have the right one.
It looks like the Object Information Data Librarby class.
When I attempt to extract the library definitions from ole32.dll, I get the error: "Unable to locate input type library"
Cata
|
|
|
|
|
If you want to do things this way, you must create an IDL file (don't use headers and don't worry about compiling to a DLL) and import additional IDL files when necessary. Interface documentation should list what IDL file they are found in. If not, check for a similar IDL file that matches the name of the header file (filename.h to filename.idl).
Take a look at the following CP article which gives an example of how to go from IDL files -> midl.exe -> typelib -> tlbimp.exe -> interop assembly: Using MSHTML Advanced Hosting Interfaces[^].
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Heath Stewart wrote:
Take a look at the following CP article which gives an example of how to go from IDL files -> midl.exe -> typelib -> tlbimp.exe -> interop assembly: Using MSHTML Advanced Hosting Interfaces[^].
You beat me to it, I was looking for the link to that article to post a reply and thought I would check to see if you had posted a reply yet.
- Nick Parker My Blog
|
|
|
|
|
Thanks.
I just realised I've been looking for all my DLL's etc in my windows directory, when i have all the base source code in my VS SDK.
About ready to kick myself over that one.
By the way, I'm trying to navigate through dos, and I can't open the long windows file names. A lot of mine have spaces in, and I can't get into the VS directory.
I've looked at a number of dos sites, but it's bugging me. How do I do this?
Or is there an easier way of moving all source code into a low level directory with the tool exe's that i'm using?
Cheers
Cata
|
|
|
|
|
Wrap your path in quotes any time it has spaces. This has been the case since Windows 95 and applies to any other shell (like bash, csh, tsh, etc. in *nix)!
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Currently I am pulling all the classes I need relating to drag and drop from the IDL's in the SDK, and packing them into my own custom one.
Is this the right thing to do?
Also, when adding an interface to my IDL, do i need to include the square bracketed section above it that looks like:
[
object,
uuid(0000010e-0000-0000-C000-000000000046),
pointer_default(unique)
]
I think I do, but i'm not sure.
Also, can I add enumerations and structures to this? Or is it only interfaces?
Cheers
Cata
|
|
|
|
|
First, add the paths to your INCLUDE enviroment variable and you won't have to worry about paths.
Second, no, you shouldn't include the interface information - they're already defined you're just forward-defining them.
There's plenty of information about IDL in the PSDK. You should read some of that. Also, just do what the author did in the article that I linked. He does everything you need to do, just with different IDL files, interfaces, and structs.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
What's the INCLUDE enviroment variable? I have never encountered this before. Where does it go? Is this in VS?
I don't need to add the square bracketed stuff? In the article the guy uses only the UUID number in the interfaces he uses in his IDL file.
Unfortunately, while i have the platform SDK source code, I don't have the documentation to go with it. I'll have a gander on the MSDN though.
Sorry to keep asking sometimes dumb questions, but by almost all standards, I am a programming novice, and acronyms and half the names of things don't mean anything to me.
Cheers
Cata
|
|
|
|
|
You've never done any C/C++? The INCLUDE environment variable is a user- or system-environment variable that includes a semi-colon delimited list (colon-delimited in *nix) of directories where header files (or, in this case, IDL files) are located. You can set this in VS, too, but then it only applies to the VS environment instead of all applications (if an application is open, you'll have to restart it after setting the env. var.).
This is true for any modern OS shell.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I can read C++ and C, but the only C++ I've coded is for a Mod using the HL engine. So no actualy executables there. Just seting variables and methods in the game DLL.
Wrote my first hello world program 18 months ago in java and got VS 12 months ago. Been learning on the fly since then.
So where / how can I set this enviroment variable?
Cata
[edit]LOL! You mean #include don't you? Followed by a list of directory paths?
If so, I know that. I'm just a half asleep dozy f wit.
Where do I set it up?
[edit 2]
No you don't.
I'll shut up now and go and look it up.
|
|
|
|
|
This is the extent? COM is by no means an easy subject and Windows shell programming gets even harder (since it uses COM and adds certain complexities). You really should spend some time learning the basics. Learning things as you go is always good and you should never stop, but you have to have experience upon which to build.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Right, I have found the INCLUDE setup in my Enviroment variables of System Properties.
I have added the following entries to my INCLUDE section in the System Variables:
"F:\MSDN\SDK\v1.1\include\; F:\MSDN\Vc7\include; F:\MSDN\Vc7\PlatformSDK\Include"
Now, it appears that MSDN is NOT my VS directory, and i'm not sure if this is correct, but it contains all the include information of the PlatformSDK.
Now, i am not sure if this is actualy working, as i still gain no joy with the objidl.idl, which is in the directory "F:\MSDN\Vc7\PlatformSDK\Include".
Not sure what's wrong there.
I know Heath. I am going through the COM tutorials at the moment. I'm more than happy to take a step away from where I am in order to learn background knowledge, and since i've hit this whole DragDrop thing, i've learned a reasonable amout about C and COM from reading articles and experimenting with sample code.
It's actualy quite fun
I will continue on with these tutorials, but I think my next step would be to get my tools working. Midl and TblImp.
Cheers
Cata
[EDIT]
Never mind, i had a problem with not running vcv*something*.bat. It appears to be all working now.
Although, midl does not appear to be generating the objidl.tlb file I asked it to, despite running without errors.
|
|
|
|
|
Don't include spaces between delimited directories in your INCLUDE env. var. (or PATH, LIB, or any other delimited path env. vars. like that). Also keep in mind that you can use env. vars. even in those env. vars. by defining things like PSDK=F:\MSDN\Vc7\PlatformSDK as another env. var., then using INCLUDE=%PSDK%\Include.
Also, you should download the newest PSDK from MSDN. If you're using the one in your VS.NET directory, you're using an OLD one. Also, don't include directories in your env. var. in quotes. That is one thing that the OS will handle correctly when using the UI. When doing this in a command line, you would have to type it like so:
set INCLUDE=C:\SomeDir;C:\SomeDir\Some Other Dir Make sure there's no space around the equals (=) sign and don't use quoes there, either. Also note that typing this in the command prompt only makes the INCLUDE env. var. durable for THAT particular command prompt instance. You can also append directories like so:
set INCLUDE=%INCLUDE%;C:\SomeDir;C:\SomeDir\Some Other Dir Again, if you change the env. vars. through the Advanced tab in the system properties, you must restart any program - including the command prompt - in which you need these changes reflected (for instance, an open Internet Explorer browser window won't benefit from this change, so you don't have to restart it).
Note also that VS.NET maintains it's own list, though there is ways to make it use the system and user environment variables instead. See the Options for details and just try it out.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Ok, downloading SDK now.
the INCLUDE variables are working, and I have the MIDL working as far as I can see. It runs at least without errors.
Does not seem to generate the file i was hoping for.
used the "/tlb objidl.tlb" extention, and got nowt from it. Did a full system search.
Cata
|
|
|
|
|
You're not supposed to compile the whole thing to a typelib, only forward-define the interfaces in your own IDL file and then compile that to a typelib. See the midl.exe documentation for more command-line options. Each IDL file doesn't have a typelib because many are typically meant to be included in other IDL files while being defined in a library elsewhere - this isn't your concern. Do what the linked article I gave you mentions and generate a typelib including the interfaces, structs, and enums you need ONLY. Anymore - unless you're planning on interop'ing the whole COM for a huge-ars library - is just overkill and bloat.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Ok Heath, I think I am almost there.
One last question.
I've looked through the idl files, and a lot of the structures and enumerations I need are embedded in interfaces.
Some of them are in ones that I do not need.
Can I pull them out and put them in the file on their own? Or do they need to be included in the interfaces?
I ask this because STGMEDIUM is represented in objidl.idl by uSTGMEDIUM. Are these the same? As their layout is identical.
Cheers
Cata
|
|
|
|
|
This thread is starting to have an interesting curve to it....
Just felt like mumbling a little, I have been flipping though one of those Java books Ryan gave me. So far I am unimpressed with the language.
- Nick Parker My Blog
|
|
|
|
|
I hated it... it doesn't compile to an executable and runs slow as a 36 stone 1 legged man with a ball and chain round his ankle.
It's also ugly, a real mission to program, and the documentation is nigh on impossible to navigate quickly.
I moved from java in text pad to C# in VS.NET. It was like replacing a wooden go kart with a ferri.
So yeah, burn your java book in the name of all that is holy!
(Well, ok, java might have SOME uses... but... there you go. My experience was bad )
Can we make an arc? WHEEE!
:p
Cata
|
|
|
|
|
It appears that the library itself is lacking, but I haven't gotten into that much yet.
- Nick Parker My Blog
|
|
|
|
|
My dad would say
"In my days, the only class libraries we had were those built by ourselves."
But my dads about 2000 years old and made computers with sticks and stones.
Cata
|
|
|
|