|
-
Aug 31st, 2005, 01:36 AM
#1
Thread Starter
Lively Member
[RESOLVED] DoEvents in class files
How to call DoEvents in a class file? The project is compiled into a DLL and the class has no access to any forms.
-
Aug 31st, 2005, 01:39 AM
#2
Re: DoEvents in class files
You can call it from a module in the app like ... Application.DoEvents, but I am not 100% sure about inside a dll?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 31st, 2005, 01:42 AM
#3
Thread Starter
Lively Member
Re: DoEvents in class files
When I write Application.DoEvents() I get an error:
Name 'Application' is not declared.
-
Aug 31st, 2005, 01:43 AM
#4
Re: DoEvents in class files
Application.DoEvents() raises all pending events for the current application. It is a Shared method of the Application class, so no object reference is needed. Note that the Application class is a member of the System.Windows.Forms namespace, so your project must have a reference to the appropriate library. A Windows Control Library project will have that reference by default, but I think you'd have to add it yourself if your's is a Class Library project.
-
Aug 31st, 2005, 01:45 AM
#5
Thread Starter
Lively Member
Re: DoEvents in class files
Imports System.Windows.Forms
Namespace or type 'Forms' for the Imports 'System.Windows.Forms' cannot be found.
-
Aug 31st, 2005, 01:54 AM
#6
Re: DoEvents in class files
 Originally Posted by itportal
Imports System.Windows.Forms
Namespace or type 'Forms' for the Imports 'System.Windows.Forms' cannot be found.
I said you have to add a reference to your project. You cannot import a namespace for which you do not have a reference to its library.
-
Aug 31st, 2005, 01:58 AM
#7
Thread Starter
Lively Member
Re: DoEvents in class files
The DLL and the main project (where the exe file is) are different projects. The EXE has a refrence to the DLL, but how to link the DLL with the EXE?
-
Aug 31st, 2005, 02:07 AM
#8
Re: DoEvents in class files
That's not what I meant. I meant that you need to right-click your DLL project in the Solution Explorer, select Add Reference, then select System.Windows.Forms.dll from the .NET tab. This will add a reference to that assembly, which contains the System.Windows.Forms namespace and thus the System.Windows.Forms.Application class, to your DLL project. Then you can import the System.Windows.Forms namespace if you want and access all its members.
Note that importing a namespace only means you don't have to qualify the names of its members in your code. It doesn't give you access to anything that you didn't have before.
-
Aug 31st, 2005, 02:18 AM
#9
Thread Starter
Lively Member
Re: DoEvents in class files
Sorry, I haven't understand you right It worked. Thanks a lot!
-
Aug 31st, 2005, 02:27 AM
#10
Re: [RESOLVED] DoEvents in class files
All's well that works well.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|