Dear mr woka,is it possible to connect to other application too??Thanks a lot..
Printable View
Dear mr woka,is it possible to connect to other application too??Thanks a lot..
@Wokawidget: Thanks a lot for this multithreading project... :wave:
I will try experimenting with it.... :)
Although WokaWidget's multithreading code is quite old now, it is ideal for what I am doing (spread a large VB6 number-crunching simulation across multiple processor cores).
Had it all working in the IDE and compiled, but then when I add a manifest file, the mobjgateway DLL immediately crashes with an error on SetWindowsLong
This problem is simple to reproduce with WokaWidgets vbGateway2\Demo\Project1 code. Just add a standard 'XP' manifest (as project1.exe.manifest containing the usual mscomctl assembly for XP look). Start up project1.exe and bingo - you get an error 'Unable to hook window', which is generated by SetWindowLong in sub HookWindow in mobjgateway.vbp
SO... Can anyone tell me what the manifest is screwing up and why? Then point me at how to resolve it???
Thanks
(The original zip file is at http://www.vbforums.com/attachment.p...1&d=1089126436)
Wow. Never seen than before.
I have never really done any work in anger with manifest files and vb6 I am afraid.
But why it should cause an error of that nature is a bit of a mystery.
Can you post a screen shot of the error...and the function, including all the functions lines of code, where this occured.
cheers,
woka
ps Glad you like it :)
While I do love my vbGateway code...it's a little bit outdated now thanks to .NET.
You know you can do in .NET in a few lines of code what this entire project does?
Woka
Woka,
Here are the full details of the problem with vbGateway. I have stripped out all the code down to the bare minimum - even removing the .startlink
The test code
Procedure: The attached zip file contains the vbp and also the manifest file. The second zip is the original Woka gateway code with vbGateway2Code:Option Explicit
Private WithEvents mobjGateway As Gateway
Private Sub Form_Load()
Set mobjGateway = New Gateway
End Sub
1. Compile vbGateway2 and register the dll
2. Compile SimpleDemo (after adding the wokawidget gateway reference of course)
3. Now run SimpleDemo.exe and you will see -
This seems to be from vbGateway2 'HookWindow' -
4. Now rename SimpleDemo.exe.manifest as, say, TTSimpleDemo.exe.manifest. Start SimpleDemo again - it works fineCode:Public Sub HookWindow(ByRef pobjGateway As Gateway)
Dim lngOldWndProc As Long
lngOldWndProc = SetWindowLong(pobjGateway.hWnd, GWL_WNDPROC, AddressOf WndProc)
If lngOldWndProc > 0 Then
pobjGateway.OldWndProc = lngOldWndProc
If mcolItems Is Nothing Then
Set mcolItems = New Collection
End If
mcolItems.Add ObjPtr(pobjGateway), CreateKey(pobjGateway.hWnd)
Else
Err.Raise vbObjectError, App.EXEName, "Unable to hook window."
End If
End Sub
5. Now put SimpleDemo.exe.manifest back again and edit SimpleDemo.vbp to remove the 'Set mobjGateway = New Gateway' statement. Compile and run again - it works fine as well. (By the way, the reason the 'DoesNothing' button is there is simply to show that the manifest is working and doesn't have an error (i.e. you see the XP-style button).
I have no idea why the manifest is screwing up the gateway - I always thought it simply forces use of the 6.0 version of MSCOMCTL (along with InitCommonControls in the code, which I have also stripped out in this test).
Help!!
Hi
Im trying to test this code but when i open vbgateway2.vbp then i get this message in vb6:
Unable to set version compatible component: c:/program files/student works/common/compatible/vbgateway2.dll
How to fix it?
Try using the version in post 46 if the one in post #1 is causing the problem or vice-verse. If the source code of the dll is included recompile it with the version compatibility set to none. Save the project then recompile using "Binary Compatibility" using the previous dll you just created as the reference.
Hi thank you for interesting my problem.
The point is this error Message is appearing when i open source code of this dll. There are no compiled dll in this package. Other test projects in this package are opening but they require this dll. If i compile it althought this error message then using it as a reference i get actixeX error.
I done what you suggested but it dosnt help. There are still the same error. What can i else do?
Make sure you unselect the dll reference in the main projects (project that uses the dll) then save it and re reference the dll again.
Good point thanks:) now i can open and test project from /demo/ folder. It works great. But i still have problems with demos in /Multithreading/ folder.
DemoUi - there are still errors with activex obkect when i click search.
Set objsearch = CreateObject("searchThread.clsNewSearch")
This is highlighten
ThreadUI - no errors, but nothing happens when i Run this project.
What can i do to run it?
Nobody?:(
Well - over three years later your post helped me. I had a manifest file which didn't take effect in the IDE so everything worked. Outside the IDE - crash with the same message you mentioned. I can live without the manifest!
`If lngOldWndProc > 0 Then` in `HookWindow` code seems to be awfully wrong. Has to be `If lngOldWndProc <> 0 Then` for sure.
Whether this will fix issue with manifests is a separate question :-))
cheers,
</wqw>