 |
 |
Index ‹ Visual Studio ‹ Visual Basic
|
- Previous
- 1
- 2
- Visual Studio C++ >> bit shiftingi wanna shift the unsigned int e.g.
from
BINARY: 0110 0000 0011 0000 1101 0000 0000 0001
into
BINARY: 1000 0000 0000 0100 0000 0000 0000 0000
with the code i << 18;
but it seems that it won't detected the leading zero during shifting ?
and wrongly give me
0100 0000 0000 0100 0000 0000 0000 0000
any solution for that ?~
- 3
- Visual Basic >> When using a Frame my embeded contols loose their text?I have a frame with 3 controls on it. 1 text box and 2 option controls. The
text control gets it's text from an INI file and the Option buttons get their
captions from this same ini file when the program loads. For some reason when
the program loads I loose the text and captions? I have been playing around
with the frame settings but have had no luck so I must be missing something
simple right?
- 4
- Visual Studio C++ >> How to convert _TCHAR * to string?I need to check command line parameter
if (argv[1] == option) .... // option is a string variable
And argv is defined as _TCHAR* argv[] by MSVS wizard.
The code don't work and it's very hard to convert argv[1] to string.
- 5
- Visual Basic >> Profiler in Team Edn for S/W Dev--Any successes?I am struggling to get any useful performance data out of the profiling tool
in Visual Studio Team Edition for Software Developers.
On a simple command-line app, it reports bogus call paths in release and
release with debug info builds. With a debug build, the results are so
compromised by the overhead of calling inline functions that they are useless.
With a real-world, complex app, it either runs out of memory trying to
analyze the profile data or crashes. This is for an app that runs in 1.2
seconds normally.
It won't even run the app if you select sampling; profiling must be done
with instrumented code.
I've used MetroWerks Hierarchical Profiler, Rational Quantify and Compware
DevPartner, and all have provided useful information that have enabled me to
track down, understand and fix performance problems. Not so Visual Studio
Team Edition. Is there some trick that makes it work usefully?
Thanks,
Rich
- 6
- MFC >> When user trying to quit program while thread is runningHi guys, I have a memory leak problem. When I tried to quit program by click
'x' at top right corner while my ui thread and its child worker thread are
running, debugger display following messages:
The thread 0x570 has exited with code 0 (0x0).
The thread 0x574 has exited with code 0 (0x0).
Detected memory leaks!
Dumping objects ->
c:\work\MyProject\MyUIthread.cpp(396) : {717} normal block at 0x00C17CA8, 4
bytes long.
a CWinThread object at $00C17BF0, 112 bytes long
c:\work\MyProject\MyUIthread.cpp(96) : {550} normal block at 0x00C17FC0, 12
bytes long.
Data: < > CD CD CD CD CD CD CD CD CD CD CD CD
c:\work\MyProject\MyUIthread.cpp(94) : {549} normal block at 0x00C17398, 12
bytes long.
Data: < 0 > C2 30 00 00 F2 C9 00 02 D1 01 00 00
c:\work\MyProject\mainfrm.cpp(746) : {535} client block at 0x00C17E40,
subtype 0, 128 bytes long.
a CMyUIThread object at $00C17E40, 128 bytes long
Object dump complete.
The thread 0x304 has exited with code 0 (0x0).
The program c:\work\MyProject\Debug\MyProject.exe' has exited with code 0
(0x0).
In my program, ui thread is created when certain selection made from combo
box and shutdown, deleted when combo box selection. Ui thread creates one
worker thread for communication with embeded system via COM port. So in a
normal situation(combo box changed), shutdown prccedure is like this: First,
main frame PostThreadMessage(QUIT) to ui thread. Ui thread set 'running'
flag to FALSE to let worker thread exit its while(running) loop. Just before
exit, worker thread sends another QUIT packet to embeded system to power off
then PostMessage(THREAD_QUIT) to main frame. Message handler in main frame
wait for m_hThread and delete pThread. Debugger doesn't complain about this
normal shutdown and the program looks just fine when I try without debugger.
Can I neglect this situation?
Where can I insert this shutdown procedure when program is forced to quit
while threads running?
Any suggestion appreciated. Cheers
- 7
- 8
- Visual Basic [VB] >> Share source files among projects?Is it possible to share a single source file among two or more Projects in a
Solution?
I'm not talking about a DLL, just a .vb file that might contain a class or
module with common code to be compiled into each project. That way this
code can be updated once instead of makiing duplicate changes to identical
code within each project.
I have tried putting the source in a common folder, then using Add Existing
Item to add it to each project, but that creates a separate copy of the file
in each project folder. Then I'm back to keeping changes syncronized
manually.
I have been searching VB.NET help and newsgroups, but either this can't be
done or I am asking the wrong questions.
thanks
Dick
- 9
- MFC >> Fatloss computer programI have been using this computer program for a couple weeks now and i am very pleased with the results so far. its a software fatloss program, if your looking for a diet/weightloss plan i reccomend you check this place out first: http://fatloss9.50webs.com
- 10
- MFC >> Debug Assertion FailedFirst the problem, then I'll attempt to post all of the info I think may be pertinent. I get the following message when I try to register a dll on a machine other than the one I built it on
Debug Assertion Failed
Program: C:\B7\DV7333\bin32\REGSVR32.EX
File: olelink.cp
Line: 29
When developing, it builds fine and I am able to register it on the development machine
This is an MFC dll which implements the class wizard generated: DllGetClassObject, DllCanUnloadNow, and DllRegisterServer functions
I have used depends.exe on the target machine and all it's dependcies are accounted for
I have another VB created dll that provides a few classes that are used in this problem dll. I access those via the following statement: #import "vbdll.dll" no_namespac
This stuff I dont really understand, but it appears to work. I do receive the following warning message during the mfc dll build
d:\program files\microsoft visual studio\vc98\include\comip.h(31) : warning C4042: '_IID' : has bad storage clas
d:\program files\microsoft visual studio\vc98\include\comip.h(57) : see reference to class template instantiation '_com_IIID<struct _vbdllObject,&struct __s_GUID _GUID_22b44757_efef_4c0b_be51_32138fe6eb04>' being compile
S:\VC++\dllProject\dllCode.cpp(328) : see reference to class template instantiation '_com_ptr_t<class _com_IIID<struct __vbdllObject,&struct __s_GUID _GUID_22b44757_efef_4c0b_be51_32138fe6eb04>>' being compile
The VB dll IS registered and IS in the path on the target machine
Thanks in advance for any insight into this problem
Jeremy
- 11
- Visual Basic [VB] >> ADO in VB.NETHi
I want to apply ADO object in VB.NET. Can I bind the textbox, editmask,
combo box and grid control to the ADO recordset?
Any sample would be appreciated.
Thanks...Douglas
- 12
- Mcse >> OT: Beta 2Beta 2 is here!!!
Windows Server 2007 beta 2
Office 2007 beta 2
Vista beta 2
All should be available to anyone, I think!
And yeah, Virtual Server R2 SP1 beta 1, too!
What a great time to be a nerd!
- 13
- Visual Basic [VB] >> Fill Combobox with DVI would like to fill a combobox with the values of one
column of the dataview I am using. When I set it up the
way I expect it would be, I get every row in the combobox
says: System.Data.DataRowView
If I click on one, it navigates to the right place. Any
idea how I would get the System.Data.DataRowView to show
the actual values in the column?
Thanks
- 14
- Visual Basic [VB] >> Math.Round and SQL Server RoundI'm trying to determine the best approach for rounding in an application I'm
building. Unfortunately it appears as though SQL Server and VB.NET round in
different ways.
SQL Server
select round(123.465,2)
returns
123.470
Which I think is correct.
VB.NET
Math.Round(123.465, 2)
returns
123.46
Through online help I have read that the VB.NET way of doing it is "called
rounding to nearest, or banker's rounding."
I guess my first question is what is correct (when determining Tax or Sale
prices)?
My next question is what is the best approach for standarizing? Can I make
SQL Server act like VB.NET or VB.NET act like SQL Server?
Are there additional functions either in SQL Server or VB.NET that I am
missing?
Also it appears as if the behavior is consistent throughout the VB.NET
environment (formatcurrency and formatpercent).
There are certain parts of the applicaiton where it makes sense for SQL
Server to calculate some of the numbers and other where it makes sense for
VB.NET to.
Thanks
- 15
|
| Author |
Message |
DaraLune

|
Posted: Sun Oct 23 07:02:51 CDT 2005 |
Top |
Visual Basic >> Errors
Dear All,
Does anyone know of a third party tool that can add error handling code to
all subs/functions in a class or module to a specified format which then can
be customised to deal with the errors likely to be raised at the code?
I have been neglectful in adding error handling code and comments as I go as
the project has now grown and other developers are going to be using my
code. I know that it is bad practice and I have learned my lesson, but any
advice, other than its your own fault, would be most welcome. If I have to
create my own add-in for the future, can anyone suggest how I can
programatically find the start and end of a sub to add the suggested code?
Thanks again.
Alastair MacFarlane
Visual Studio179
|
| |
|
| |
 |
Ralph

|
Posted: Sun Oct 23 07:02:51 CDT 2005 |
Top |
Visual Basic >> Errors
"Alastair MacFarlane" <EMail@HideDomain.com> wrote in message
news:uPL$EMail@HideDomain.com...
> Dear All,
>
> Does anyone know of a third party tool that can add error handling code to
> all subs/functions in a class or module to a specified format which then
can
> be customised to deal with the errors likely to be raised at the code?
>
> I have been neglectful in adding error handling code and comments as I go
as
> the project has now grown and other developers are going to be using my
> code. I know that it is bad practice and I have learned my lesson, but any
> advice, other than its your own fault, would be most welcome. If I have to
> create my own add-in for the future, can anyone suggest how I can
> programatically find the start and end of a sub to add the suggested code?
>
> Thanks again.
>
> Alastair MacFarlane
>
You can start with MZTools:
http://www.mztools.com/
Which has an excellent price of free.
-ralph
|
| |
|
| |
 |
Alastair

|
Posted: Sun Oct 23 07:13:36 CDT 2005 |
Top |
Visual Basic >> Errors
Thanks Ralph,
I have heard it being mentioned on this group before but never looked into
it. I will now. Thanks for your help.
Alastair
"Ralph" <EMail@HideDomain.com> wrote in message
news:EMail@HideDomain.com...
>
> "Alastair MacFarlane" <EMail@HideDomain.com> wrote in message
> news:uPL$EMail@HideDomain.com...
>> Dear All,
>>
>> Does anyone know of a third party tool that can add error handling code
>> to
>> all subs/functions in a class or module to a specified format which then
> can
>> be customised to deal with the errors likely to be raised at the code?
>>
>> I have been neglectful in adding error handling code and comments as I go
> as
>> the project has now grown and other developers are going to be using my
>> code. I know that it is bad practice and I have learned my lesson, but
>> any
>> advice, other than its your own fault, would be most welcome. If I have
>> to
>> create my own add-in for the future, can anyone suggest how I can
>> programatically find the start and end of a sub to add the suggested
>> code?
>>
>> Thanks again.
>>
>> Alastair MacFarlane
>>
>
> You can start with MZTools:
> http://www.mztools.com/
> Which has an excellent price of free.
>
> -ralph
>
>
>
|
| |
|
| |
 |
Ralph

|
Posted: Sun Oct 23 07:50:19 CDT 2005 |
Top |
Visual Basic >> Errors
"Alastair MacFarlane" <EMail@HideDomain.com> wrote in message
news:EMail@HideDomain.com...
> Thanks Ralph,
>
> I have heard it being mentioned on this group before but never looked into
> it. I will now. Thanks for your help.
>
> Alastair
>
>
> "Ralph" <EMail@HideDomain.com> wrote in message
> news:EMail@HideDomain.com...
> >
> > "Alastair MacFarlane" <EMail@HideDomain.com> wrote in message
> > news:uPL$EMail@HideDomain.com...
> >> Dear All,
> >>
> >> Does anyone know of a third party tool that can add error handling code
> >> to
> >> all subs/functions in a class or module to a specified format which
then
> > can
> >> be customised to deal with the errors likely to be raised at the code?
> >>
> >> I have been neglectful in adding error handling code and comments as I
go
> > as
> >> the project has now grown and other developers are going to be using my
> >> code. I know that it is bad practice and I have learned my lesson, but
> >> any
> >> advice, other than its your own fault, would be most welcome. If I have
> >> to
> >> create my own add-in for the future, can anyone suggest how I can
> >> programatically find the start and end of a sub to add the suggested
> >> code?
> >>
> >> Thanks again.
> >>
> >> Alastair MacFarlane
> >>
> >
> > You can start with MZTools:
> > http://www.mztools.com/
> > Which has an excellent price of free.
> >
> > -ralph
> >
I just now noticed that you want to write your 'own' Addins (too early here,
only one cup of coffee, smile).
[Warning: Opinion piece follows. <g>]
I used to write my own Addins, but got out of the habit because,
1) they usually turn into non-trivial projects,
2) documentation is scanty and MS documentation is often misleading or just
plain wrong,
3) it became easlier to use a 3rd party editor with 'macro' tools (I used
CodeWright, but there are other better, less expensive ones, out there), and
4) you usually need to do a bit of final massage on the code (ie, OSFA
seldom applied) so attempting to write a 'fully' automated tool, often saved
less time that imagined.
Here is a little book that I found useful. (Surprised to find it still
available) The Extensibilty model changed a bit from VB5 - but most of
Microsoft's documentation errors were repeated with VB6, so this book is
very useful. It also tends to put everything in one place so you can look at
it as a whole.
http://www.amazon.com/exec/obidos/ASIN/1576101673/gridlinxsoftware/102-6720874-9080925
hope this helps,
-ralph
|
| |
|
| |
 |
Alastair

|
Posted: Sun Oct 23 08:13:58 CDT 2005 |
Top |
Visual Basic >> Errors
Thanks again Ralph,
I have written a few add-ins for Office 2000 but never for the VB IDE. Maybe
I will look into it more seriously (only when I have more time). Maybe next
centuary! My wife argues that it is Sunday and I should spend some time with
her. Thanks for the support.
Alastair MacFarlane
p.s. Although I am tempted... no, I had better not!
"Ralph" <EMail@HideDomain.com> wrote in message
news:EMail@HideDomain.com...
>
> "Alastair MacFarlane" <EMail@HideDomain.com> wrote in message
> news:EMail@HideDomain.com...
>> Thanks Ralph,
>>
>> I have heard it being mentioned on this group before but never looked
>> into
>> it. I will now. Thanks for your help.
>>
>> Alastair
>>
>>
>> "Ralph" <EMail@HideDomain.com> wrote in message
>> news:EMail@HideDomain.com...
>> >
>> > "Alastair MacFarlane" <EMail@HideDomain.com> wrote in message
>> > news:uPL$EMail@HideDomain.com...
>> >> Dear All,
>> >>
>> >> Does anyone know of a third party tool that can add error handling
>> >> code
>> >> to
>> >> all subs/functions in a class or module to a specified format which
> then
>> > can
>> >> be customised to deal with the errors likely to be raised at the code?
>> >>
>> >> I have been neglectful in adding error handling code and comments as I
> go
>> > as
>> >> the project has now grown and other developers are going to be using
>> >> my
>> >> code. I know that it is bad practice and I have learned my lesson, but
>> >> any
>> >> advice, other than its your own fault, would be most welcome. If I
>> >> have
>> >> to
>> >> create my own add-in for the future, can anyone suggest how I can
>> >> programatically find the start and end of a sub to add the suggested
>> >> code?
>> >>
>> >> Thanks again.
>> >>
>> >> Alastair MacFarlane
>> >>
>> >
>> > You can start with MZTools:
>> > http://www.mztools.com/
>> > Which has an excellent price of free.
>> >
>> > -ralph
>> >
>
> I just now noticed that you want to write your 'own' Addins (too early
> here,
> only one cup of coffee, smile).
>
> [Warning: Opinion piece follows. <g>]
> I used to write my own Addins, but got out of the habit because,
> 1) they usually turn into non-trivial projects,
> 2) documentation is scanty and MS documentation is often misleading or
> just
> plain wrong,
> 3) it became easlier to use a 3rd party editor with 'macro' tools (I used
> CodeWright, but there are other better, less expensive ones, out there),
> and
> 4) you usually need to do a bit of final massage on the code (ie, OSFA
> seldom applied) so attempting to write a 'fully' automated tool, often
> saved
> less time that imagined.
>
> Here is a little book that I found useful. (Surprised to find it still
> available) The Extensibilty model changed a bit from VB5 - but most of
> Microsoft's documentation errors were repeated with VB6, so this book is
> very useful. It also tends to put everything in one place so you can look
> at
> it as a whole.
> http://www.amazon.com/exec/obidos/ASIN/1576101673/gridlinxsoftware/102-6720874-9080925
>
> hope this helps,
> -ralph
>
>
|
| |
|
| |
 |
Ralph

|
Posted: Sun Oct 23 08:22:53 CDT 2005 |
Top |
Visual Basic >> Errors
"Alastair MacFarlane" <EMail@HideDomain.com> wrote in message
news:EMail@HideDomain.com...
> Thanks Ralph,
>
> I have heard it being mentioned on this group before but never looked into
> it. I will now. Thanks for your help.
>
> Alastair
>
>
> "Ralph" <EMail@HideDomain.com> wrote in message
> news:EMail@HideDomain.com...
> >
> > "Alastair MacFarlane" <EMail@HideDomain.com> wrote in message
> > news:uPL$EMail@HideDomain.com...
> >> Dear All,
> >>
> >> Does anyone know of a third party tool that can add error handling code
> >> to
> >> all subs/functions in a class or module to a specified format which
then
> > can
> >> be customised to deal with the errors likely to be raised at the code?
> >>
> >> I have been neglectful in adding error handling code and comments as I
go
> > as
> >> the project has now grown and other developers are going to be using my
> >> code. I know that it is bad practice and I have learned my lesson, but
> >> any
> >> advice, other than its your own fault, would be most welcome. If I have
> >> to
> >> create my own add-in for the future, can anyone suggest how I can
> >> programatically find the start and end of a sub to add the suggested
> >> code?
> >>
> >> Thanks again.
> >>
> >> Alastair MacFarlane
> >>
> >
> > You can start with MZTools:
> > http://www.mztools.com/
> > Which has an excellent price of free.
> >
> > -ralph
> >
Also don't overlook the ability to create your own project, form, and class
templates. Create a good generic project and save it in...
C:\Program Files\Microsoft Visual Studio\Vb98\Template\Projects
Do the same for other items and place them in subdirectories.
Using a tool such as MZTools makes it a snap to change the names.
Visual Basic Template Manager Add-In:
http://vb.mvps.org/tools/Vb6ControlsAndComponents.asp
-ralph
|
| |
|
| |
 |
Ralph

|
Posted: Sun Oct 23 08:35:22 CDT 2005 |
Top |
Visual Basic >> Errors
"Alastair MacFarlane" <EMail@HideDomain.com> wrote in message
news:%23$EMail@HideDomain.com...
> Thanks again Ralph,
>
> I have written a few add-ins for Office 2000 but never for the VB IDE.
Maybe
> I will look into it more seriously (only when I have more time). Maybe
next
> centuary! My wife argues that it is Sunday and I should spend some time
with
> her. Thanks for the support.
>
> Alastair MacFarlane
>
> p.s. Although I am tempted... no, I had better not!
>
It is NFL Sunday here, so my wife has long since learned to not make any
such unreasonable requests of my time. However, neither will any coding be
done today. <g>
-ralph
> "Ralph" <EMail@HideDomain.com> wrote in message
> news:EMail@HideDomain.com...
> >
> > "Alastair MacFarlane" <EMail@HideDomain.com> wrote in message
> > news:EMail@HideDomain.com...
> >> Thanks Ralph,
> >>
> >> I have heard it being mentioned on this group before but never looked
> >> into
> >> it. I will now. Thanks for your help.
> >>
> >> Alastair
> >>
> >>
> >> "Ralph" <EMail@HideDomain.com> wrote in message
> >> news:EMail@HideDomain.com...
> >> >
> >> > "Alastair MacFarlane" <EMail@HideDomain.com> wrote in message
> >> > news:uPL$EMail@HideDomain.com...
> >> >> Dear All,
> >> >>
> >> >> Does anyone know of a third party tool that can add error handling
> >> >> code
> >> >> to
> >> >> all subs/functions in a class or module to a specified format which
> > then
> >> > can
> >> >> be customised to deal with the errors likely to be raised at the
code?
> >> >>
> >> >> I have been neglectful in adding error handling code and comments as
I
> > go
> >> > as
> >> >> the project has now grown and other developers are going to be using
> >> >> my
> >> >> code. I know that it is bad practice and I have learned my lesson,
but
> >> >> any
> >> >> advice, other than its your own fault, would be most welcome. If I
> >> >> have
> >> >> to
> >> >> create my own add-in for the future, can anyone suggest how I can
> >> >> programatically find the start and end of a sub to add the suggested
> >> >> code?
> >> >>
> >> >> Thanks again.
> >> >>
> >> >> Alastair MacFarlane
> >> >>
> >> >
> >> > You can start with MZTools:
> >> > http://www.mztools.com/
> >> > Which has an excellent price of free.
> >> >
> >> > -ralph
> >> >
> >
> > I just now noticed that you want to write your 'own' Addins (too early
> > here,
> > only one cup of coffee, smile).
> >
> > [Warning: Opinion piece follows. <g>]
> > I used to write my own Addins, but got out of the habit because,
> > 1) they usually turn into non-trivial projects,
> > 2) documentation is scanty and MS documentation is often misleading or
> > just
> > plain wrong,
> > 3) it became easlier to use a 3rd party editor with 'macro' tools (I
used
> > CodeWright, but there are other better, less expensive ones, out there),
> > and
> > 4) you usually need to do a bit of final massage on the code (ie, OSFA
> > seldom applied) so attempting to write a 'fully' automated tool, often
> > saved
> > less time that imagined.
> >
> > Here is a little book that I found useful. (Surprised to find it still
> > available) The Extensibilty model changed a bit from VB5 - but most of
> > Microsoft's documentation errors were repeated with VB6, so this book is
> > very useful. It also tends to put everything in one place so you can
look
> > at
> > it as a whole.
> >
http://www.amazon.com/exec/obidos/ASIN/1576101673/gridlinxsoftware/102-6720874-9080925
> >
> > hope this helps,
> > -ralph
> >
> >
>
>
|
| |
|
| |
 |
Alastair

|
Posted: Sun Oct 23 08:51:22 CDT 2005 |
Top |
Visual Basic >> Errors
Thanks Ralph,
I will check out the site of your link (and by the way the wife says Hi!!!).
It must be the same the Western World over!!!
Alastair
"Ralph" <EMail@HideDomain.com> wrote in message
news:EMail@HideDomain.com...
>
> "Alastair MacFarlane" <EMail@HideDomain.com> wrote in message
> news:EMail@HideDomain.com...
>> Thanks Ralph,
>>
>> I have heard it being mentioned on this group before but never looked
>> into
>> it. I will now. Thanks for your help.
>>
>> Alastair
>>
>>
>> "Ralph" <EMail@HideDomain.com> wrote in message
>> news:EMail@HideDomain.com...
>> >
>> > "Alastair MacFarlane" <EMail@HideDomain.com> wrote in message
>> > news:uPL$EMail@HideDomain.com...
>> >> Dear All,
>> >>
>> >> Does anyone know of a third party tool that can add error handling
>> >> code
>> >> to
>> >> all subs/functions in a class or module to a specified format which
> then
>> > can
>> >> be customised to deal with the errors likely to be raised at the code?
>> >>
>> >> I have been neglectful in adding error handling code and comments as I
> go
>> > as
>> >> the project has now grown and other developers are going to be using
>> >> my
>> >> code. I know that it is bad practice and I have learned my lesson, but
>> >> any
>> >> advice, other than its your own fault, would be most welcome. If I
>> >> have
>> >> to
>> >> create my own add-in for the future, can anyone suggest how I can
>> >> programatically find the start and end of a sub to add the suggested
>> >> code?
>> >>
>> >> Thanks again.
>> >>
>> >> Alastair MacFarlane
>> >>
>> >
>> > You can start with MZTools:
>> > http://www.mztools.com/
>> > Which has an excellent price of free.
>> >
>> > -ralph
>> >
>
> Also don't overlook the ability to create your own project, form, and
> class
> templates. Create a good generic project and save it in...
> C:\Program Files\Microsoft Visual Studio\Vb98\Template\Projects
> Do the same for other items and place them in subdirectories.
>
> Using a tool such as MZTools makes it a snap to change the names.
>
> Visual Basic Template Manager Add-In:
> http://vb.mvps.org/tools/Vb6ControlsAndComponents.asp
>
> -ralph
>
>
|
| |
|
| |
 |
Que

|
Posted: Sun Oct 23 11:04:47 CDT 2005 |
Top |
Visual Basic >> Errors
Using MZTools, if you want your error message to look like this:
Form1:Form_Load:110
Error 5: Invalid procedure call or argument
Where 110 is the line number the error occurred on, then use the error
handler below, change as needed.
- Download and install MZTools:
http://www.mztools.com/v3/mztools3.htm
- Go to MZTools Options|Error Handler, and paste the following(unwrap as
needed):
On Error GoTo {PROCEDURE_NAME}_Error
{PROCEDURE_BODY}
ExitMe:
On Error GoTo 0
Exit {PROCEDURE_TYPE}
{PROCEDURE_NAME}_Error:
MsgBox "{MODULE_NAME}:{PROCEDURE_NAME}:" & ErL & vbCrLf & "Error " &
Err.Number & ": " & Err.Description
Resume ExitMe
- Go to every form and routine and add an error handler by clicking on the
icon on the tool bar. Add line numbers to each routines as well, which is
another button in MZTools toolbar.
Note that MZTools doesn't offer adding numbers to all routines in one step,
so you have to go to each routine and click on a toolbar button. You may
find Ctrl+DownArrow useful. Other Add-ins lets you do it for the whole
project. If you change your code and add lines, you have to redo it for that
procedure.
MZTools also doesn't change the routine name in the error handler if you
edited the sub/function name, so you either have to change it manually, or
click on the toolbar button to add a second error handler with the correct
name and delete the old one. If you prefer to make the error label with a
fixed name, just change "{PROCEDURE_NAME}_Error" to "ErrorHandler" above.
"Alastair MacFarlane" <EMail@HideDomain.com> wrote in message
news:uPL$EMail@HideDomain.com...
> Dear All,
>
> Does anyone know of a third party tool that can add error handling code to
> all subs/functions in a class or module to a specified format which then
> can be customised to deal with the errors likely to be raised at the code?
>
> I have been neglectful in adding error handling code and comments as I go
> as the project has now grown and other developers are going to be using my
> code. I know that it is bad practice and I have learned my lesson, but any
> advice, other than its your own fault, would be most welcome. If I have to
> create my own add-in for the future, can anyone suggest how I can
> programatically find the start and end of a sub to add the suggested code?
>
> Thanks again.
>
> Alastair MacFarlane
>
>
>
|
| |
|
| |
 |
Alastair

|
Posted: Sun Oct 23 12:12:38 CDT 2005 |
Top |
Visual Basic >> Errors
Thanks for the input Que,
I have downloade MZTools and will take into consideration your advice.
Thanks again.
Alastair MacFarlane
"Que" <EMail@HideDomain.com> wrote in message
news:OSx85t%EMail@HideDomain.com...
> Using MZTools, if you want your error message to look like this:
>
> Form1:Form_Load:110
> Error 5: Invalid procedure call or argument
>
> Where 110 is the line number the error occurred on, then use the error
> handler below, change as needed.
>
> - Download and install MZTools:
>
> http://www.mztools.com/v3/mztools3.htm
>
> - Go to MZTools Options|Error Handler, and paste the following(unwrap as
> needed):
>
> On Error GoTo {PROCEDURE_NAME}_Error
>
> {PROCEDURE_BODY}
>
> ExitMe:
> On Error GoTo 0
> Exit {PROCEDURE_TYPE}
> {PROCEDURE_NAME}_Error:
> MsgBox "{MODULE_NAME}:{PROCEDURE_NAME}:" & ErL & vbCrLf & "Error " &
> Err.Number & ": " & Err.Description
> Resume ExitMe
>
> - Go to every form and routine and add an error handler by clicking on the
> icon on the tool bar. Add line numbers to each routines as well, which is
> another button in MZTools toolbar.
>
> Note that MZTools doesn't offer adding numbers to all routines in one
> step, so you have to go to each routine and click on a toolbar button. You
> may find Ctrl+DownArrow useful. Other Add-ins lets you do it for the whole
> project. If you change your code and add lines, you have to redo it for
> that procedure.
>
> MZTools also doesn't change the routine name in the error handler if you
> edited the sub/function name, so you either have to change it manually, or
> click on the toolbar button to add a second error handler with the correct
> name and delete the old one. If you prefer to make the error label with a
> fixed name, just change "{PROCEDURE_NAME}_Error" to "ErrorHandler" above.
>
>
>
>
>
> "Alastair MacFarlane" <EMail@HideDomain.com> wrote in message
> news:uPL$EMail@HideDomain.com...
>> Dear All,
>>
>> Does anyone know of a third party tool that can add error handling code
>> to all subs/functions in a class or module to a specified format which
>> then can be customised to deal with the errors likely to be raised at the
>> code?
>>
>> I have been neglectful in adding error handling code and comments as I go
>> as the project has now grown and other developers are going to be using
>> my code. I know that it is bad practice and I have learned my lesson, but
>> any advice, other than its your own fault, would be most welcome. If I
>> have to create my own add-in for the future, can anyone suggest how I can
>> programatically find the start and end of a sub to add the suggested
>> code?
>>
>> Thanks again.
>>
>> Alastair MacFarlane
>>
>>
>>
>
>
|
| |
|
| |
 |
Ken

|
Posted: Sun Oct 23 12:53:53 CDT 2005 |
Top |
Visual Basic >> Errors
"Alastair MacFarlane" <EMail@HideDomain.com> wrote in message
news:uPL$EMail@HideDomain.com...
> Dear All,
>
> Does anyone know of a third party tool that can add error handling code to
> all subs/functions in a class or module to a specified format which then
> can be customised to deal with the errors likely to be raised at the code?
>
Others mentioned MZTools... CodeSMART's another add-in that can do this but
it's not free.
Another option is VB Watch. It's a bit expensive but will make your app
nearly bullet proof, even against the good ol' Dr Watson, without changing
the source you're actually working on. It adds all required code during the
compile phase.
"Error messages can include: error description, procedure name, line number,
parameter and variable values, object properties, call stack, screenshot,
run-time library versions, and even execution trace procedure-by-procedure,
line-by-line. Have the users email all this info immediately when an error
happens. This is the fastest way to fix bugs ever discovered."
VB Watch Profiler, Protector, Debugger
http://www.aivosto.com/vbwatch.html
--
Ken Halter - MS-MVP-VB - http://www.vbsight.com
DLL Hell problems? Try ComGuard - http://www.vbsight.com/ComGuard.htm
Please keep all discussions in the groups..
|
| |
|
| |
 |
Ken

|
Posted: Sun Oct 23 13:03:45 CDT 2005 |
Top |
Visual Basic >> Errors
"Ken Halter" <EMail@HideDomain.com> wrote in message
news:uk8ZUn$EMail@HideDomain.com...
>
> It adds all required code during the compile phase.
Actually, it's been a while and I remember that it doesn't do it during the
compile phase. Instead, you click "the button" and it'll optionally create a
copy of the project that includes the required code. Either way, it's pretty
cool. (and pretty expensive)
--
Ken Halter - MS-MVP-VB - http://www.vbsight.com
DLL Hell problems? Try ComGuard - http://www.vbsight.com/ComGuard.htm
Please keep all discussions in the groups..
|
| |
|
| |
 |
Carlos

|
Posted: Mon Oct 31 07:37:33 CST 2005 |
Top |
Visual Basic >> Errors
"Que" <EMail@HideDomain.com> escribió en el mensaje
news:OSx85t%EMail@HideDomain.com...
> Note that MZTools doesn't offer adding numbers to all routines in one
> step, so you have to go to each routine and click on a toolbar button. You
> may find Ctrl+DownArrow useful. Other Add-ins lets you do it for the whole
> project.
MZ-Tools 3.0 allows to add line numbers to a whole project or file using the
proper context menu in the Project Explorer. I know it is not the most
intuitive thing, but it's explained in the help file and in the FAQ section
on the web site:
http://www.mztools.com/v3/faq.htm#LineNumbering
The user interface to select the scope of operations was improved in
MZ-Tools 4.0 for VS.NET.
You can´t add error handlers to all function with one click, though.
--
Best regards,
Carlos J. Quintero
MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com
|
| |
|
| |
 |
Carlos

|
Posted: Mon Oct 31 07:45:49 CST 2005 |
Top |
Visual Basic >> Errors
I collected many resources for developers of add-ins for several hosts in a
section on my web site:
http://www.mztools.com/resources_addin_developers.htm
I was not aware of that book, I'll add it to the list tomorrow.
--
Best regards,
Carlos J. Quintero
MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com
"Ralph" <EMail@HideDomain.com> escribió en el mensaje
news:EMail@HideDomain.com...
> I just now noticed that you want to write your 'own' Addins (too early
> here,
> only one cup of coffee, smile).
>
> [Warning: Opinion piece follows. <g>]
> I used to write my own Addins, but got out of the habit because,
> 1) they usually turn into non-trivial projects,
> 2) documentation is scanty and MS documentation is often misleading or
> just
> plain wrong,
> 3) it became easlier to use a 3rd party editor with 'macro' tools (I used
> CodeWright, but there are other better, less expensive ones, out there),
> and
> 4) you usually need to do a bit of final massage on the code (ie, OSFA
> seldom applied) so attempting to write a 'fully' automated tool, often
> saved
> less time that imagined.
>
> Here is a little book that I found useful. (Surprised to find it still
> available) The Extensibilty model changed a bit from VB5 - but most of
> Microsoft's documentation errors were repeated with VB6, so this book is
> very useful. It also tends to put everything in one place so you can look
> at
> it as a whole.
> http://www.amazon.com/exec/obidos/ASIN/1576101673/gridlinxsoftware/102-6720874-9080925
>
> hope this helps,
> -ralph
>
>
|
| |
|
| |
 |
| |
 |
Index ‹ Visual Studio ‹ Visual Basic |
- Next
- 1
- MFC >> VC2008 dpiaware manifest?When you create a new MFC application with the wizard in VC2008 you will see
the following code in stdafx.h:
#pragma comment(linker,"/manifestdependency:\"type='win32'
name='Microsoft.Windows.Common-Controls' version='6.0.0.0'
processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
What do you write in stdafx.h to add the dpiaware manifest (se below) the
same way?
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<asmv3:application xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<asmv3:windowsSettings
xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
<dpiAware>true</dpiAware>
</asmv3:windowsSettings>
</asmv3:application>
</assembly>
Best regards from Gaute
- 2
- Visual Basic >> compiling the entire thingHi guys...
Here's a quick query...
I have almost finished making my first project in vb...
But I am confused...as to how should i compile the entire project and make a
setup ...
i know how to make the exe files...
I searched through MSDN but couldn't get much info...
And does the setup do everything ?...I mean what about the DSNs I created in
Control Panel, and what about my entire database ?...is that also properly
installed with the setup ?...
And how do i start doing it ?....
Please help...
thanks..
anupam
anupam@anupamjain.com
- 3
- 4
- MFC >> How to implement transparent static on dialog box?I would implement a transparent static text to show
the status text of the progress on dialog box.
The background of dialog box is not default system color.
Originally, I set the bk mode of the static to transparent mode
and return a NULL_BRUSH in OnCtlColor() of dialog class.
It can fit my requirement if the static text is not changed.
However, the old text is not erased if the static text is changed.
I think I need to override some function to erase background first.
Which function do I need to override to erase the background?
or I need to implement my own static class to do so? and how?
Best Regards
Jackal Huang
- 5
- Visual Basic [VB] >> TUTORIALS ON COMPUTER PROGRAMMINGlanguages Have the complete details regarding programming languages.
A-Z about programming languages like Java J2EE, C++, code
implementation guides and more.
http://operatingsys.blogspot.com/
Google.com is not only a search engine but also does webadvertising
through websites and blogs.
Lakhs of common people are earning hundreds of dollars through online
advertising.
It also has other products like chatting,google earth,google talk etc.
Genuine Internet jobs for all. Earn Unlimited income.visit
http://googlepromisesyou.blogspot.com/
- 6
- VB Scripts >> Check for enabled NIC and execute commandHello all. I am trying to write a script with minimal vbs knowledge. I have
downloaded scriptomatic 2.0 and have made some progress but have come to a
head.
Background:
We use WSUS for all local and remote users in an NT4 domain (soon to be
migrated to AD). Remote users connect via Cisco VPN client. The clients
installs as a network device, is disable when not in use and enables when
the GUI is loaded. The detection frequency setting for WSUS runs at
intervals of 8 - 20 hours according to the documentation. This causes the
remote client to almost never check for updates.
Solution:
Write a script which checks or better still listens if the VPN is active
(objItem.ServiceName(CVirtA) and when it becomes active
(objItem.NetConnectionStatus=2) then run the command (wuauclt /detectnow).
I have the beginnings of something pasted in below which obviously doesnt
quite work unless you comment a few lines here and there, but doing that
does not give the desired result.
Can I use wsh/vbs to monitor the connection or would this need to work on a
timer?
If a timer how would that affect memory consumption on the notebook?
TIA.
' start script
On Error Resume
Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20
arrComputers = Array("localhost")
For Each strComputer in arrComputers
WScript.Echo
WScript.Echo "======================"
WScript.Echo "Computer: "& strComputer
WScript.Echo "======================"
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM
Win32_NetworkAdapter", "WQL", _
wbemFlagReturnImmediately
+ wbemFlagForwardOnly)
If objItem.ServiceName="CVirtA" And objItem.NetConnectionStatus="2" Then
' C:\Windows\SYSTEM32\wuauclt.exe /detectnow
End If
- 7
- Visual Studio C++ >> Problem with covariant return typesThe following code won't compile (error C2555: 'B::f': overriding virtual
function return type differs and is not covariant from 'A::f') unless I
moved the definitions of X and Y to before the definitions of A and B
respectively. Now I can understand that the compiler doesn't know that Y is
derived from X when parsing B but at the very least this is a very confusing
error message and I'm not sure it shouldn't be accepted.
Rob.
class X;
class A
{
public:
virtual X* f () const = 0;
};
class X
{
public:
};
class Y;
class B : public A
{
public:
virtual Y* f () const;
};
class Y : public X
{
public:
};
- 8
- Visual Studio C++ >> Simple question about dllimportI've got a h file for a usb device that has definitions of function exported
from a dll. An example would be (with #defines translated):
extern "C" __declspec(dllimport) int __stdcall FT_Open(int deviceNumber, int
*pHandle);
but where is the actual dll filename specified so my program knows where to
find it?
Thanks,
Michael
- 9
- MFC >> ActiveX in MFCI'm trying to create an ActiveX control in MFC.
I have a library which was provided for the development of an MFC program
NOT ActiveX.
I made a sample ActiveX and included the library under
Project->Settings->Link Tab but after building the ActiveX and viewing the
control in Test Container, no methods were exposed??
Am I doing something wrong or will the library NOT work with an ActiveX???
Thanks
David
- 10
- Visual Basic >> output to text file copied data from Clipboard...Hi, I'm a bit new to this... but here it goes.
I have created a macro on which in one part it does a copy of a
certain selected text. I wan't this copied strings, which I belive is
now on the clipboard, pasted on a text file.... or essantially I wan't
to know how can I output this copied data to a text file? any ideas...
thanks in advance!
-Jona
- 11
- Visual Basic [VB] >> Console.Writeline hangs if user click into the console windowI have a console app which does it's job and frequently spits out status
messages with Console.Writeline. I noticed that, if the user
accidentally clicks into the black console window, the cursor changes to
a filled white rectangle, and the app hangs at the next Console.Write
statement.
Can that be solved somehow? It is very dangerous for the application to
stop just because of a wrong mouse click.
I know I could reimplement the app as a windows forms app and write the
status messages to a ListView - but it is more of a fundamental
question. Since if this cannot be solved, I'd never write another
console app again for production environments.
Thanks for any help
Urs
- 12
- Visual Basic >> Calling a Macro from another workbookHi,
Yes I have read up on the different ways of doing this, but I always
come to the same problem.
In my current code I have the line
Application.Run ("T1Seed1.xls!Main")
Which works fine (it calls the "Main" macro in T1Seed2.xls). But once
the "main" macro is run, the rest of my current macro doesn't run.
Here is my code (missing some variables thata bit above, but thats
ok).
Dim ESDUFile, RootPath, WorkBookToOpen, SheetToOpen, BuildingHeight As
String
ESDUFile = Sheets("Rotate spf red").Cells(10, 9)
RootPath = ESDUFile
Do While Right(RootPath, 1) <> "\"
RootPath = Left(RootPath, Len(RootPath) - 1)
Loop
BuildingHeight = 225
SeedScale = 345
For A = 1 To NumTowers
For B = 1 To 2
SheetToOpen = "T" & A & "Seed" & B & ".xls"
WorkBookToOpen = RootPath & SheetToOpen
FileCopy ESDUFile, WorkBookToOpen
Range("C22:C57").Copy
Workbooks.Open WorkBookToOpen
Windows(SheetToOpen).Activate
Sheets("RWDI_Factors").Select
Range("H67").Select
ActiveSheet.Paste
Range("D7") = SeedScale
Range("D6") = BuildingHeight
Application.Run ("T1Seed1.xls!Main")
Sheets("Factors").Select
Application.CutCopyMode = False 'closes the clipboard with massive
amounts of data thus does not prompt to save or close
ActiveWorkbook.Close True ' false means not to save, true means to
save and close
Windows("MR_Setup_underDevelopment_profiles.xls").Activate
Next B
Next A
It works fine up until right after the Application.Run line where it
will not continue on (ie it will not select the "Factors" sheet or do
anything after).
Is there another way I can do this that will allow the original macro
to continue running after it calls the macro in the other workbook?
Any help would be appreciated.
Jack
- 13
- VB Scripts >> force clicking on an objectHello,
How can I force clicking on an object,
if I have the following code, and I want to do click on event_view -
How can I do that ?
Thanks :)
The code :
-------------
<input type="hidden" id="event_view" onclick = "myview" />
...
- 14
- Visual Basic >> Icon size problemHello,
My program's frmAbout has an icon. The ico file has the same icon in two
sizes, 16 x 16 and 32 x 32 pixels. I don't want the smaller one to be
displayed to users. So, the size should be 32 x 32 pixels.
Anyway, on some computers the icon will be displayed in size 16 x 16
pixels. How could I prevent this?
The ico file is dislayed in picIcon which is a PictureBox element. Its
ScaleMode is "Pixel", AutoDraw is "False", and AutoSize is "False".
The ScaleMode value of frmAbout is "Twip".
What should I do?
Thanks,
Mika
- 15
- Visual Basic >> "Reading emails from All Public folders"Hi,
I am developing a vb application to read the latest arrived mail from
"All public folders" through outlook. This should be dynamic as the
folders increase in the "All Public folders", The program should read
the folders accordingly.
Can anyone help on this.
|
|
|