473,471 Members | 2,053 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Threads and DLL's

I have written a COM object that I am calling from a separate VB.net project.
I am calling the DLL by using "Call myClass". I need to know when the DLL
has finished processing before it returns to the main project to run more
code. Do I need to use threads? Is there an example that will lead me in
the right direction?
Jun 27 '08 #1
3 930
You may want to provide some more details as it looks like you are already
doing something special (the usual behavior for a call is to return only
when done).

Also you don't call a class so you likely call your code using something
else than "Call MyClass"
--
Patrice

"SDecou" <SD****@discussions.microsoft.coma écrit dans le message de
groupe de discussion : 25**********************************@microsoft.com...
I have written a COM object that I am calling from a separate VB.net
project.
I am calling the DLL by using "Call myClass". I need to know when the DLL
has finished processing before it returns to the main project to run more
code. Do I need to use threads? Is there an example that will lead me in
the right direction?

Jun 27 '08 #2
The project consists of a COM object and a Word template created using
VB.net. After the Word template loads, I am calling a sub called Main that is
retrieving my Outlook Contacts folder and then will list all the contacts in
that folder. After my COM object finishes it's processing, I would like to
return to my Word template the selected Outlook contact object from the COM.
But right now, when we call the COM object, the code in the COM object runs
at the same time as the code that is running in our word template. We're
unable to control this process. We've looked at threads, but we're not sure
if that's the best approach.

We are not calling a class. We are calling a a sub called "Main" in the COM
object.

"Patrice" wrote:
You may want to provide some more details as it looks like you are already
doing something special (the usual behavior for a call is to return only
when done).

Also you don't call a class so you likely call your code using something
else than "Call MyClass"
--
Patrice

"SDecou" <SD****@discussions.microsoft.coma crit dans le message de
groupe de discussion : 25**********************************@microsoft.com...
I have written a COM object that I am calling from a separate VB.net
project.
I am calling the DLL by using "Call myClass". I need to know when the DLL
has finished processing before it returns to the main project to run more
code. Do I need to use threads? Is there an example that will lead me in
the right direction?

Jun 27 '08 #3
And the code that runs in your Word template is triggered by ? My
understanding is that this is some code that automatically runs when Word is
launched.

Possible options would be :
- to have this code call Outlook rather than your main code (but you are
still "forking" as it will run inside Word in parallel with your main code,
tirggred by Word launch)
- don't set up Word to autorun this code but rather expose it as en entry
point (as you have done for your com object) so that you main vb.net code
can calls explicitely this "entry point" when appropriate instead of being
called by Word at launch time.

i.e. rather than to add some code to simulate sequential code my preference
would be to reorganize my code so that it runs sequentially...
--
Patrice

"SDecou" <SD****@discussions.microsoft.coma écrit dans le message de
groupe de discussion : BA**********************************@microsoft.com...
The project consists of a COM object and a Word template created using
VB.net. After the Word template loads, I am calling a sub called Main that
is
retrieving my Outlook Contacts folder and then will list all the contacts
in
that folder. After my COM object finishes it's processing, I would like
to
return to my Word template the selected Outlook contact object from the
COM.
But right now, when we call the COM object, the code in the COM object
runs
at the same time as the code that is running in our word template. We're
unable to control this process. We've looked at threads, but we're not
sure
if that's the best approach.

We are not calling a class. We are calling a a sub called "Main" in the
COM
object.

"Patrice" wrote:
>You may want to provide some more details as it looks like you are
already
doing something special (the usual behavior for a call is to return only
when done).

Also you don't call a class so you likely call your code using something
else than "Call MyClass"
--
Patrice

"SDecou" <SD****@discussions.microsoft.coma crit dans le message de
groupe de discussion :
25**********************************@microsoft.com...
I have written a COM object that I am calling from a separate VB.net
project.
I am calling the DLL by using "Call myClass". I need to know when the
DLL
has finished processing before it returns to the main project to run
more
code. Do I need to use threads? Is there an example that will lead me
in
the right direction?

Jun 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: siddharthkhare | last post by:
Hi All, I have a block of code. I don't want more than five threads to enter this block simultaneously... Some thing like this lock(MyObject) { ....do work here. }
6
by: Ram P. Dash | last post by:
Hi: I've a third party DLL (not a .NET class library PE) which I use using DllImport attribute in my application running in multiple threads invoking different methods of the same DLL. The...
3
by: mjheitland | last post by:
Hi, I like to know how many threads are used by a Threading.Timer object. When I create a Threading.Timer object calling a short running method every 5 seconds I expected to have one additional...
2
by: Oenone | last post by:
I'm upgrading a DLL from VB6 to VB.NET. The DLL gets called from an ASP.NET web application. In the VB6 code there is a module-level object which stores the context about what the user is doing...
2
by: mmitchell | last post by:
I have a service that executes a method in a dll. This method spawns several threads. When I stop the service I notice the process doesn't stop right away. I assume the threads that some time to...
8
by: Flack | last post by:
Hey guys, In my app I have a bitmap where drawing is done and in the form's paint method I show the bitmap: private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e) {...
4
by: Al Norman | last post by:
We have two separate DLLs that do not interact (directly, at least). One is an MFC extension DLL that was built back in VC++ 6 days (but has been recompiled with VS2005). The other is a DLL that...
3
by: =?Utf-8?B?cm9iaW50dw==?= | last post by:
Hi, While debugging my application I have noticed that occasionally a message saying "Win32 Thread xxxx exited with code 0 (0x0)" appearing in the debug window. I investigated this some more and...
3
by: frogga | last post by:
Hi All I've got a real puzzler that I just can't seem to get my head around. Basically I'm writing a server-client using a third party dll to access their database. The third party library...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.