473,769 Members | 2,331 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to efficiently call methods in DLL?

How to I call a method within a DLL every 1 minute? The DLL (written in
VB.NET) will download messages from a mail server and enter them into a
database. This application is a mixture of CFMX and VB.NET. Here are two
methods:

1. Allow the CFMX task scheduler to call a CF template, which then calls the
DLL as an object and references some method (s) within it.

2. Create a VB.NET EXE that references the DLL and use Windows Task
Scheduler.

3. ?

Which of the above is better and why?

Also, how do I initially load this DLL into memory so the any of the above
methods do not have to initiate the DLL every time they run? In other
words, if VB.NET is used, how does it retain a pointer to the object without
having to create one each time the scheduler runs and also avoid intiating
the object each time.

Thanks,
Brett
Nov 21 '05 #1
6 1274
If you want to do it that often (every minute) then build the
scheduling into the dll itself. Have a thread that kicks off the
procedure every minute and sleeps the rest of the time.

Sam
On Sun, 2 Jan 2005 13:28:05 -0500, "Brett" <no@spam.net> wrote:
How to I call a method within a DLL every 1 minute? The DLL (written in
VB.NET) will download messages from a mail server and enter them into a
database. This application is a mixture of CFMX and VB.NET. Here are two
methods:

1. Allow the CFMX task scheduler to call a CF template, which then calls the
DLL as an object and references some method (s) within it.

2. Create a VB.NET EXE that references the DLL and use Windows Task
Scheduler.

3. ?

Which of the above is better and why?

Also, how do I initially load this DLL into memory so the any of the above
methods do not have to initiate the DLL every time they run? In other
words, if VB.NET is used, how does it retain a pointer to the object without
having to create one each time the scheduler runs and also avoid intiating
the object each time.

Thanks,
Brett


Nov 21 '05 #2
Are you referring to the timer class?

How do I initially load the DLL to set everything in motion?

Thanks,
Brett

"Samuel R. Neff" <bl****@newsgro up.nospam> wrote in message
news:jh******** *************** *********@4ax.c om...
If you want to do it that often (every minute) then build the
scheduling into the dll itself. Have a thread that kicks off the
procedure every minute and sleeps the rest of the time.

Sam
On Sun, 2 Jan 2005 13:28:05 -0500, "Brett" <no@spam.net> wrote:
How to I call a method within a DLL every 1 minute? The DLL (written in
VB.NET) will download messages from a mail server and enter them into a
database. This application is a mixture of CFMX and VB.NET. Here are two
methods:

1. Allow the CFMX task scheduler to call a CF template, which then calls
the
DLL as an object and references some method (s) within it.

2. Create a VB.NET EXE that references the DLL and use Windows Task
Scheduler.

3. ?

Which of the above is better and why?

Also, how do I initially load this DLL into memory so the any of the above
methods do not have to initiate the DLL every time they run? In other
words, if VB.NET is used, how does it retain a pointer to the object
without
having to create one each time the scheduler runs and also avoid
intiating
the object each time.

Thanks,
Brett

Nov 21 '05 #3

I wasn't referring to the Timer class but that certainly should work..
I was just referring to basic thread programming in .NET. But a Timer
would work fine as well.

The initiation depends on if you need the VB.NET process to
communicate back to CFMX or if it's just run and forget. If it's
run-once and forget, use an EXE and CFEXECUTE.

If you need to communicate back and forth you can either expose a COM
interface from the VB.NET app or use Gestaltech's Black Knight to
create a CFX tag.

http://www.gestaltech.com

One has to wonder why you're jumping through all these hoops
unnecessarily though. If you need to use VB.NET for part of your app,
why not do the whole thing in ASPX? If you need to do some part in
CFMX, then why not do the whole thing in CFML? Seems like the
services you're mixing can be easily accomplished in either language
and the mixing just adds a layer of complexity that isn't necessary.

My $0.02.

Sam
On Sun, 2 Jan 2005 16:33:42 -0500, "Brett" <no@spam.net> wrote:
Are you referring to the timer class?

How do I initially load the DLL to set everything in motion?

Thanks,
Brett


Nov 21 '05 #4
The program was originally in CFMX. However, VB.NET performs better in
certain areas. The program is structured in such a way that certain parts
run in complete isolation as little stand alone programs. They are very
small and rewritting them in VB.NET is very feasible.

Brett

"Samuel R. Neff" <bl****@newsgro up.nospam> wrote in message
news:04******** *************** *********@4ax.c om...

I wasn't referring to the Timer class but that certainly should work..
I was just referring to basic thread programming in .NET. But a Timer
would work fine as well.

The initiation depends on if you need the VB.NET process to
communicate back to CFMX or if it's just run and forget. If it's
run-once and forget, use an EXE and CFEXECUTE.

If you need to communicate back and forth you can either expose a COM
interface from the VB.NET app or use Gestaltech's Black Knight to
create a CFX tag.

http://www.gestaltech.com

One has to wonder why you're jumping through all these hoops
unnecessarily though. If you need to use VB.NET for part of your app,
why not do the whole thing in ASPX? If you need to do some part in
CFMX, then why not do the whole thing in CFML? Seems like the
services you're mixing can be easily accomplished in either language
and the mixing just adds a layer of complexity that isn't necessary.

My $0.02.

Sam
On Sun, 2 Jan 2005 16:33:42 -0500, "Brett" <no@spam.net> wrote:
Are you referring to the timer class?

How do I initially load the DLL to set everything in motion?

Thanks,
Brett

Nov 21 '05 #5
Brett,

One other thing I completely forgot to mention is Blue Dragon. If you
really want to integrate .NET code with a CFMX page then take a look
at using New Atlanta's Blue Dragon server instead of Macromedia's. It
runs native .NET code and allows you to call .NET assemblies directly.
You can even use apsx controls within a CFMX page.

It's still in beta though, not sure when it will be released (been in
beta for at least a year and a half).

http://www.newatlanta.com/products/bluedragon

Best regards,

Sam


Nov 21 '05 #6
I know of Blue Dragon but some of the things I'm using with Macromedia
aren't support by Blue Dragon. I can comlpetely write certain sections in
VB.NET because they run in isolation. It's the better solution.

One other thing - CFMX will often peg the server at 100% cpu if it is doing
some processing such as reading a file, parsing it and inserting it into a
two dimensional array. The process is jrun.exe, which is the heart of CFMX.
Does .NET occassionally also do this (Pegging the cpu at 100%)? Some the
only way to stop it is to restart CFMX Server. Not good. All sessions,
application vars, database connections, etc. die at that point.

Thanks,
Brett

"Samuel R. Neff" <bl****@newsgro up.nospam> wrote in message
news:l6******** *************** *********@4ax.c om...
Brett,

One other thing I completely forgot to mention is Blue Dragon. If you
really want to integrate .NET code with a CFMX page then take a look
at using New Atlanta's Blue Dragon server instead of Macromedia's. It
runs native .NET code and allows you to call .NET assemblies directly.
You can even use apsx controls within a CFMX page.

It's still in beta though, not sure when it will be released (been in
beta for at least a year and a half).

http://www.newatlanta.com/products/bluedragon

Best regards,

Sam

Nov 21 '05 #7

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

Similar topics

14
1537
by: Klaus Neuner | last post by:
Hello, I need to gather information that is contained in various files. Like so: file1: ===================== foo : 1 2 bar : 2 4
1
2352
by: dennis luehring | last post by:
i try to "publish" some of my very stupid methods (i need this for an interpreter) function_one procedure_one here is the code --------- class core {
8
3856
by: ThomasR | last post by:
I understand that virtual methods on inherited objects are slower than non-virtual methods because of the indirection required to support the call. However, when looking at IL code produced by the compiler, I notice that all methods on object variables use callvirt instead of call, regardless of whether the method is truly virtual or not. I assume this allows .NET to check if the object reference is null or not before invoking the...
37
2144
by: Anony | last post by:
Hi All, I'm trying to chunk a long string SourceString into lines of LineLength using this code: Dim sReturn As String = "" Dim iPos As Integer = 0 Do Until iPos >= SourceString.Length - LineLength sReturn += SourceString.Substring(iPos, LineLength) + vbCrLf iPos += LineLength
46
3862
by: Steven T. Hatton | last post by:
I just read §2.11.3 of D&E, and I have to say, I'm quite puzzled by what it says. http://java.sun.com/docs/books/tutorial/essential/concurrency/syncrgb.html <shrug> -- NOUN:1. Money or property bequeathed to another by will. 2. Something handed down from an ancestor or a predecessor or from the past: a legacy of religious freedom. ETYMOLOGY: MidE legacie, office of a deputy, from OF, from ML legatia, from L legare, to depute, bequeath....
31
2554
by: krypto.wizard | last post by:
How to divide a number by 7 efficiently without using - or / operator. We can use the bit operators. I was thinking about bit shift operator but I don't know the correct answer.
9
5849
by: Steve Richter | last post by:
in a generic class, can I code the class so that I can call a static method of the generic class T? In the ConvertFrom method of the generic TypeConvert class I want to write, I have a call to the static Parse method of the conversion class. if (InValue is string) return T.Parse((string)InValue); else return base.ConvertFrom(context, culture, InValue);
9
2682
by: | last post by:
I am interested in scanning web pages for content of interest, and then auto-classifying that content. I have tables of metadata that I can use for the classification, e.g. : "John P. Jones" "Jane T. Smith" "Fred Barzowsky" "Department of Oncology" "Office of Student Affairs" "Lewis Hall" etc. etc. etc. I am wondering what the efficient way to do this in code might be. The dumb and brute-force way would be to loop through the content...
3
7004
by: Jon Harrop | last post by:
I can read bytes from a FileStream with stream.ReadByte() but that does not handle stdin. I can read from stdin with System.Console.In using reader.Read() but it is 6x slower. So how do I read bytes from stdin efficiently? -- Dr Jon D Harrop, Flying Frog Consultancy http://www.ffconsultancy.com/products/?u
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10050
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9866
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8876
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7413
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3967
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 we have to send another system
2
3570
muto222
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.