Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Generate .obj files from VB IDE 1

Status
Not open for further replies.

Akash76

Programmer
Sep 30, 2011
15
NP
Sorry if I started this thread in wrong place.

Alright, this might sound silly but, I don't want an EXE, a DLL or OCX. I want the VB IDE to generate only an .OBJ (Object Files).

Now, why would I want that ?
I want that because the Linker can do something(s) more than what Microsoft wanted VB Users to be able to do with a VB IDE.
Linker has some compiler switches which can result in the output files to be produced as a Standard DLL and or a standard DeviceDriver File (.SYS)

Although a Standard DLL with Exports and DllMain has been shown and widely available on the Net (Ron Standard DLL Method), I want to test how it goes with the /DRIVER switch. I know that a System File (.SYS) can be produced with the NativeNT for Freepascal or simply DDK / MinGW too in C / C++.

Even Freebasic can create one so I want to do it in VB6.

I tried using VB6 from Command Line but vb6 /? produced no useful results that could aid in the creation of the Object Files.

A high possibility that I think of is Linker.exe itself being used in the .OBJ creation.

Please don't reply that it depends on VB6 Runtime Files because maybe we can create one that doesnot use most of the Runtime Files at all and achieves them from the System Resources.

Thanks
 
Give it up, this is a lost cause. Monolithic linking went out with DOS anyway.

The runtimes ship as part of Windows and reg-free COM has been around since XP. Between the two, deployment using normal techniques is easier than ever.

Of if you don't want to use VB6 just don't.
 

Aren't the Object Files (*.OBJ) created when you create EXE? But they are deleted just after EXE is created. Maybe you can catch them before they are gone.....

Have fun.

---- Andy
 
> /DRIVER

Frankly I wouldn't go anywhere near V6B for writing drivers. It just is not suitable.

However, if you want to creat OBJ files ... see my version of how to create s standard DLL from VB6 in thread222-1293832. If you examine Sub Main in my shim, you'll note a point where it looks for an OBJ file. In my case we simply change some linker flags so we get a DLL but you could just get it to make a fresh copy of the OBJ file at that point, one which does not get cleaned up by the VB compilation process
 
>> The runtimes ship as part of Windows and reg-free COM has been around since XP.

Microsoft stated that there would be no MS-VB6 Runtime pre-installed in the Windows 7 Successor(s).

______________________________________________

>> Maybe you can catch them before they are gone.....
Wish I could do that ...
______________________________________________

>> Frankly I wouldn't go anywhere near V6B for writing drivers. It just is not suitable.

I'm no Driver Developer or expert but, just wanted to test it anyway. But, I agree with you. So, I had mentioned about NativeNt and DDK earlier in my post.

>> However, if you want to creat OBJ files ... see my version of how to create s standard DLL from VB6

Yes, I really appreciate it but, I know how it works because I studied it here a long ago :
Anyway thank you. But, Since I'm no expert, I would like to ask you: Can MSVBVM60.DLL functions or resources be used in the VB6 DLLs created by altering the Link.exe ? Or do we have to declare it separately?
Will it still work if there is no VB6 Runtime installed ?

Microsoft stated that there would be no MSVB6 Runtime pre-installed in the Windows 7 Successor(s).

Thanks
 
Microsoft stated that there would be no MS-VB6 Runtime pre-installed in the Windows 7 Successor(s).

This does not bother me at all. All it really means is that you will need to include the VB6 runtimes in your installer. No big deal as far as I am concerned.

I cannot imagine a world where Microsoft would ship an operating system that cannot run VB6 applications. Sure, it will eventually happen, but probably not for a very long time.

Of course, this is just my opinion.

-George
Microsoft SQL Server MVP
My Blogs
SQLCop
twitter
"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
There are trolls around who enjoy misinterpreting the entrails of Microsoft's version of saying "no comment." Please stop spreading such FUD here too.

Microsoft never said any such thing. They merely said they had no plans to announce.

Indeed, most serious developers have installed and tested on the Windows 8 Developer Preview. There you will find both the VB6 runtime and "extended runtime" components preinstalled.
 
>I know how it works

You are mising my point; I was not trying to show you how to produce a DLL (you'd already made it abundantly clear that you know ho0w this is done). I was trying to show where you could capture the creation of the OBJ file and thus keep a copy of it.

As to your other questions:

>Can MSVBVM60.DLL functions or resources be used in the VB6 DLLs
You can't avoid this, actually

>Will it still work if there is no VB6 Runtime installed ?
No

>Microsoft stated that there would be no MS-VB6 Runtime pre-installed

That support statement was really for the benefit of Windows 7 and was simply not prepared to commit to any future versions. I should point out that the base VB6 runtimes are included in the current developer preview versions of Windows 8
 
Thanks to you, I did. I added a MsgBox and it prevented Vb6 from deleting the '.Obj' Files until I clicked 'OK'.
I don't want to bug you but, I have few more questions and don't think starting a new thread for it would be Ok.

I know VB6 doesnot support multi-threading. But, VB6 compiled App crashes after calling CreateThread(). Why ?
Can Static Library(s) be linked in VB6 ? I myself, don't think it is possible.

Thanks ..
 
>> There are trolls around who enjoy misinterpreting the entrails of Microsoft
-> I'm not one of those who likes spamming.

>> Microsoft never said any such thing.
-> I read about it in multiple places so believed it to be true.
It is my ignorance if what I read was a lie / False (Alarm).

>> Indeed, most serious developers have installed and tested on the Windows 8 Developer Preview. There you will find both the VB6 runtime and "extended runtime" components preinstalled.
-> Thanks. It feels nice to read such a good thing.
 
>VB6 compiled App crashes after calling CreateThread()

Erm ...

>VB6 doesnot support multi-threading

You've answered your own question ...

Mind you there is a way to get VB to multithread. It isn't recommended, but it can work. I've illustrated the techique with an example in this forum some time ago. Hang on ... see here. Note the important caveat in that thread that it only works reliably if you compile to p-code, not to native code.
 
There are several 3rd party libraries to assist in multithreading too, some of them even free.

ActiveX Pack 1 here has some things that can be useful.

But it seems like we're trying to go for a record of "most topics in one thread" here.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top