| Looking for an intermediate/advanced VB .NET book that covers multithreading |
|
 |
Index ‹ Visual Studio ‹ Visual Basic [VB]
|
- Previous
- 1
- MFC >> new C++ blogHi all,
Guys! we all share same interest here C++!
I just thought you might be interested in looking
at and hopefully subscribing yet another C++ blog:
http://cpptruths.blogspot.com
This blog is about "Intermediate to advanced material on C++ langugae
features, standards, idioms and design patterns." I try to publish some
serious and useful C++ and OO material on this blog. I also encourage
you to subscribe cpptruths@yahoogroups.com so that you don't have to
visit the website often. You will discover many useful resources on the
cpptruths@yahoogroups homepage. Publishing frequency is around 1/2
posts per week.
Thanks.
Sumant.
- 2
- 3
- MFC >> VC++6 OLE export to MS ProjectI didn't know which group to use for this question, so I have chosen 3. Hope
I haven't annoyed anyone!...
I'm using VC++ 6.0. I am writing an export facility to MS Project. I have
exported a bunch of tasks to MS Project. I have exported resource
information and successfully attached resources to the tasks.
Question 1:
I have had to do this all by guess work as I can't find any help system
anywhere that says which methods do what and what parameter types to use. Is
there a help system detailing what methods are available to C++ through OLE,
as I am sick of having to randomly guess which of the various OLE
methods/classes to use!!
I currently open up the target application (have linked to Excel also). I
open the VB editor and read through the object browser. This offers a little
help, but the methods available through OLE usually don't quite match the VB
ones!
Question 2:
How do I export task dependencies? I found a method - AddSuccessor on the MS
project "Task" class, but when I call it and pass the name of another task
in as the parameter it just throws a COleDispatchException with error, "The
value is not valid".
I have found 2 other classes - TaskDependency and TaskDependencies, but I
can't get them to work either.
HELP !!!
- 4
- VB Scripts >> Call a function from a com dll with byref argumentsHello,
For script support of our application we use a com-DLL that provides several
functions.
Now I need to include an additional function that returns two strings to the
caller:
HRESULT Test(BSTR* para1, BSTR* para2);
How can I call the function 'test' from within the VB Script, or how does
the prototype of the function need to be changed in order to be called from
within the VB Script?
Thanks
Frank Franzoni
- 5
- Visual Basic [VB] >> Binary RepresentationI want to show the binary equivalentcy of the numbers 1 -
256. I am writing my program as a console application
and I do not want to use any String formats. Can anyone
please get me started on the right track. Thank you in
advance.
D
- 6
- Visual Basic [VB] >> aspx page to excelI got some code sample translated to vb form an article in msd2d
Public Shared Sub HtmlExportToExcel(ByVal PageObject As Page)
HttpContext.Current.Response.Buffer = True
HttpContext.Current.Response.Clear()
HttpContext.Current.Response.ContentType = "application/vnd.ms-excel"
HttpContext.Current.Response.ContentEncoding =
System.Text.Encoding.Default
HttpContext.Current.Response.AddHeader("content-disposition", _
"attachment; filename=RMCExport-" _
+ System.DateTime.Now.ToString("MMMddyyyy-hhmmtt") + ".xls")
HttpContext.Current.Response.Charset = String.Empty
PageObject.EnableViewState = False
Dim tw As StringWriter = New StringWriter()
Dim hw As HtmlTextWriter = New HtmlTextWriter(tw)
'DataGrid dg = new DataGrid();
'dg.DataSource = SourceDataTable;
'dg.DataBind();
PageObject.RenderControl (hw)
'dgrSearchResults.RenderControl(hw);
HttpContext.Current.Response.Write(tw.ToString())
HttpContext.Current.Response.Flush()
HttpContext.Current.Response.Close()
End Sub
'----------------------------------------------------------------
' Converted from C# to VB .NET using CSharpToVBConverter(1.2).
' Developed by: Kamal Patel (http://www.KamalPatel.net)
the trouble is what do I need to do to allow import system.Web.UI?
do I have to download asp.net?. I am just using visual studio vb.net
express 2005 with dotnet 2 sdk. I am not nor will I expect to develop web
application. I will only be developing window applications that may interact
with external website
I can import system.web but nothing like UI below that
- 7
- Visual Studio C++ >> importlib and include directoriesHello,
I would like to change my odl line:
importlib("c:\Program files\common files\system\ado\msado21.tlb");
to
importlib("system\ado\msado21.tlb");
and add "$(CommonProgramFiles)" to my "Additional include directories" (/I
setting in the midl compiler).
But this does not seem to work!
I really need a "generic" workaround since my project needs to be compilable
accross multiple machines which do not always have the same
"CommonProgramFiles" directory. The "Additional include directories" (/I)
works in cl but not in midl.
Any ideas?
Many thanks,
SerGioGioGio
- 8
- Mcse >> MCSE course on offerDear all,
I'm not a spammer/bot. Real guy - with a real offer for you to
consider.
I am reselling 2 IT networking courses that I have purchased. The
courses are a full MCSE 2003 and a CCNP and they will be held in a
training centre in central Mumbai, India. The school website is
www.compufield.com they have been there since 1985 and yes - taking
this offer up means spending a month in India for the training.
It is an excellent school. I did a CCNA course there and was very
happy with my score. I wanted to continue with the MCSE and CCNP and
paid in advance but I had to change my plans. The school doesn't do
refunds but was willing to do a transfer to another person and hence
this offer. All this can be verified with Computfield. Ask to speak
with Mahomedally Khairaz.
As I want to get this sorted I am willing to offer you the following:
Course Original price My price Duration (Hrs.) Duration (Days)
MCSE US$575 US$350 160 30
CCNA US$1145 US$650 160 30
Just to give you an idea of how much these course will cost elsewhere:
London: (www.london-college.com / www.bcoc.co.uk)
MCSE2003 US$2600 CCNP US$6000
New York: (www.cbit.syr.edu / www.tcytech.com / www.gt-solutions.com)
MCSE2003 US$2100-2600 CCNP US$3000-4000
India: (www.gatestraining.com)
MCSE2003 US$3900-4330 CCNP US$3345-3715
(Also - If you decide to go for a course in the western world - the
expense whilst studying full time would be much higher)
Dates of the courses are flexible and need to be arranged with
Compufield (you can in theory schedule the course for anytime in the
next year)
What's the advantage? - It's better than studying on your own. You get
trained by an expert. Taking some time off means you get it done
faster as you'll be much more focused with no distractions. You don't
need to buy a lab (and we all know the problems with simulators). You
get a flavour of what life in India is like and you're only a train
ride away from Goa and the amazing beaches there.
Why so cheap - Because it's a headache for me and I want to get this
done.
What does it include - classroom lectures, books, free access to the
lab/routers/computers/internet
What does it not include - accommodation/food/beer
I am not representing the school. I am an ex-student living in
England. As of such - I can only offer 1 MCSE course and 1 CCNP
course. That's it.
If you're interested - please get back to me on email (I don't visit
this forum often)
Ami.
compufieldami@gmail.com (this email was created especially for this
offer to avoid spam which will be coming my way...)
- 9
- 10
- Mcse >> Re: Friday sweetnessMitchS <networkyoda@nospam.gmail.com> rambled:
>
> Congratulations, salutations, and emancipations. Does this mean you
> have control over the webblocker service now?
Webblocker? I know not of what you speak.
--
KB
MCNGP #26
www.mcngp.com owes me 35 bucks.
- 11
- VB Scripts >> Display a value from an Excel worksheetI am new to vbscript and am trying to do the following:
I have an Excel worksheet with Column A being a range of dates and
Column B being the backup tape to use on that date. I would like to
run a vbscript that:
(1) Finds today's date from Column A
(2) Reports back the tape number for that row from Column B
Can someone assist me with this?
Thanks.
- 12
- MFC >> About ShellExecuteHi,
I need open a new window when I use ShellExecute to browse a http web site,
but ShellExecute open the web site in a existent IE window. So how do i do?
Thanks
- 13
- Visual Basic [VB] >> Calling sub in MDI child formsHi,
Can someone please help.
I wish to loop through all my MDI children and call a sub procedure I have
created, my problem is that the sub procedure may not exist in all the MDI
children so the program crashes.
What is the best way to tackle this.
Thanks.
Merlin
- 14
- VB Scripts >> Enumerate everything below and including Domain users?Hi,
I have a script such as listed below. The script enumerates the contents of
a OU called Domain Users. This is great however I have two child OU's, under
Domain users, one called a users and one called b users.
I.e.
Ou - Domain Users
Ou - a
User A
Ou - b
User B
What do I need to add to this script to get it two enumerate everything
below and including Domain users?
Thanks
' Export all valid recipients (= proxyAddresses) into a
' file virtual.txt
'
' Ferdinand Hoffmann & Patrick Koetter
' 20021100901
' Shamelessly stolen from
' http://www.microsoft.com/windows2000/techinfo/ \
' planning/activedirectory/bulksteps.asp
'Global variables
Dim Container
Dim OutPutFile
Dim FileSystem
'Initialize global variables
Set FileSystem = WScript.CreateObject("Scripting.FileSystemObject")
Set OutPutFile = FileSystem.CreateTextFile("virtual.txt", True)
Set Container=GetObject("LDAP://OU=Domain Users,DC=testing,DC=local")
'Enumerate Container
EnumerateUsers Container
'Clean up
OutPutFile.Close
Set FileSystem = Nothing
Set Container = Nothing
'Say Finished when your done
WScript.Echo "Finished"
WScript.Quit(0)
'List all Users
Sub EnumerateUsers(Cont)
Dim User
'Go through all Users and select them
For Each User In Cont
Select Case LCase(User.Class)
'If you find Users
Case "user"
'Select all proxyAddresses
Dim Alias
If Not IsEmpty(User.proxyAddresses) Then
For Each Alias in User.proxyAddresses
OutPutFile.WriteLine "alias: " & Alias
'WScript.Echo Alias
Next
End If
Case "organizationalunit" , "container"
EnumerateUsers User
End Select
Next
End Sub
- 15
- Visual Studio C++ >> Graphic API, stretchHi All,
I have a picture, I want to it be repaint as stretch not original size.
I know how to use stretch API.
but I remember that is copy from a HDC, how to do that in my app?
Best regards,
Boki.
///////////////////////////////////////////////////////////////////////////////
case WM_PAINT:
hdc = BeginPaint(hWnd, &ps);
// TextOut (hdc, 10, 250, psText, 9) ;
if (gpPicture)
{
// get width and height of picture
long hmWidth;
long hmHeight;
gpPicture->get_Width(&hmWidth);
gpPicture->get_Height(&hmHeight);
// convert himetric to pixels
int nWidth = MulDiv(hmWidth, GetDeviceCaps(hdc, LOGPIXELSX),
HIMETRIC_INCH);
int nHeight = MulDiv(hmHeight, GetDeviceCaps(hdc, LOGPIXELSY),
HIMETRIC_INCH);
RECT rc;
GetClientRect(hWnd, &rc);
// display picture using IPicture::Render
gpPicture->Render(hdc, 0, 0, nWidth, nHeight, 0, hmHeight, hmWidth,
-hmHeight, &rc);
}
EndPaint(hWnd, &ps);
break;
///////////////////////////////////////////////////////////////////////////////
|
| Author |
Message |
Uifz

|
Posted: Thu Jan 29 13:38:32 CST 2004 |
Top |
Visual Basic [VB] >> Looking for an intermediate/advanced VB .NET book that covers multithreading
Greetings. I received 4 VB .NET books and looking through the indices and
tables of contents, I see that none of them addresses multithreading in VB
.NET. I just bought a bunch of books because they were so cheap.
Does anyone have any suggestions for books that cover multithreading? I
have enough beginners books. I don't need any more. Need a good treatment
of multithreading. I've never used it in VB 6. I want to learn about it
in .NET.
I suppose I'd need something at the intermediate/advanced level.
I quickly looked at MSDN library for info. There's some in there. But
from my work with VS 6, I've learned that MSDN is good for reference, but
not for learning or tutorial purposes.
Thanks
Visual Studio197
|
| |
|
| |
 |
Cor

|
Posted: Thu Jan 29 13:38:32 CST 2004 |
Top |
|
| |
 |
Roger

|
Posted: Thu Jan 29 13:33:31 CST 2004 |
Top |
Visual Basic [VB] >> Looking for an intermediate/advanced VB .NET book that covers multithreading
On Thu, 29 Jan 2004 18:11:49 GMT, noid droid <a> wrote:
>Greetings. I received 4 VB .NET books and looking through the indices and
>tables of contents, I see that none of them addresses multithreading in VB
>.NET. I just bought a bunch of books because they were so cheap.
>
>Does anyone have any suggestions for books that cover multithreading? I
>have enough beginners books. I don't need any more. Need a good treatment
>of multithreading. I've never used it in VB 6. I want to learn about it
>in .NET.
>
>I suppose I'd need something at the intermediate/advanced level.
>
>I quickly looked at MSDN library for info. There's some in there. But
>from my work with VS 6, I've learned that MSDN is good for reference, but
>not for learning or tutorial purposes.
>
>Thanks
"Programming Microsoft Visual Basic.NET" by Francesco Balena (Microsoft Press).
Covers threading and virtually everything else you'll need to know to get
started.
|
| |
|
| |
 |
Da~One

|
Posted: Thu Jan 29 15:37:28 CST 2004 |
Top |
Visual Basic [VB] >> Looking for an intermediate/advanced VB .NET book that covers multithreading
"Roger Bonine" <EMail@HideDomain.com> wrote in message
news:EMail@HideDomain.com...
> On Thu, 29 Jan 2004 18:11:49 GMT, noid droid <a> wrote:
>
> >Greetings. I received 4 VB .NET books and looking through the indices
and
> >tables of contents, I see that none of them addresses multithreading in
VB
> >.NET. I just bought a bunch of books because they were so cheap.
> >
> >Does anyone have any suggestions for books that cover multithreading? I
> >have enough beginners books. I don't need any more. Need a good
treatment
> >of multithreading. I've never used it in VB 6. I want to learn about it
> >in .NET.
> >
> >I suppose I'd need something at the intermediate/advanced level.
> >
> >I quickly looked at MSDN library for info. There's some in there. But
> >from my work with VS 6, I've learned that MSDN is good for reference, but
> >not for learning or tutorial purposes.
> >
> >Thanks
>
> "Programming Microsoft Visual Basic.NET" by Francesco Balena (Microsoft
Press).
> Covers threading and virtually everything else you'll need to know to get
> started.
I second this book. It is quite expensive but well worth it!
|
| |
|
| |
 |
noid

|
Posted: Thu Jan 29 16:34:11 CST 2004 |
Top |
Visual Basic [VB] >> Looking for an intermediate/advanced VB .NET book that covers multithreading
Roger Bonine <EMail@HideDomain.com> wrote in
news:EMail@HideDomain.com:
> On Thu, 29 Jan 2004 18:11:49 GMT, noid droid <a> wrote:
>
>>Greetings. I received 4 VB .NET books and looking through the indices
>>and tables of contents, I see that none of them addresses
>>multithreading in VB .NET. I just bought a bunch of books because
>>they were so cheap.
>>
>>Does anyone have any suggestions for books that cover multithreading?
>>I have enough beginners books. I don't need any more. Need a good
>>treatment of multithreading. I've never used it in VB 6. I want to
>>learn about it in .NET.
>>
>>I suppose I'd need something at the intermediate/advanced level.
>>
>>I quickly looked at MSDN library for info. There's some in there.
>>But from my work with VS 6, I've learned that MSDN is good for
>>reference, but not for learning or tutorial purposes.
>>
>>Thanks
>
> "Programming Microsoft Visual Basic.NET" by Francesco Balena
> (Microsoft Press). Covers threading and virtually everything else
> you'll need to know to get started.
OK. Thank for the suggestion. Hopefully, there will be others.
But, are you referring to "Programming Microsoft Visual Basic .NET (Core
Reference)" or "Programming Microsoft® Visual Basic® .NET Version 2003".
Both are by Balena?
http://www.amazon.com/exec/obidos/tg/detail/-/0735613753/qid=
1075415896/sr=1-1/ref=sr_1_1/103-6891424-7657406?v=glance&s=books
http://www.amazon.com/exec/obidos/tg/detail/-/0735620598/qid=
1075415896/sr=1-3/ref=sr_1_3/103-6891424-7657406?v=glance&s=books
It seems the more advanced books always keep their high price.
Take a look at "Programming Applications for Microsoft Windows by
Richter:
http://www.amazon.com/exec/obidos/tg/detail/-/1572319968/qid=
1075416119/sr=1-3/ref=sr_1_3/103-6891424-7657406?v=glance&s=books
I bought that a year ago new for under $40. Now they want $196 used!
I've never had a book that went up in value before. Damn, they have an
electronic version of the book on the CD-ROM. One could make a copy of
the CD and sell the book for a huge profit.
noid
|
| |
|
| |
 |
noid

|
Posted: Thu Jan 29 16:48:43 CST 2004 |
Top |
|
| |
 |
Da~One

|
Posted: Thu Jan 29 17:13:22 CST 2004 |
Top |
Visual Basic [VB] >> Looking for an intermediate/advanced VB .NET book that covers multithreading
> OK. Thank for the suggestion. Hopefully, there will be others.
>
> But, are you referring to "Programming Microsoft Visual Basic .NET (Core
> Reference)" or "Programming Microsoft® Visual Basic® .NET Version 2003".
> Both are by Balena?
>
> http://www.amazon.com/exec/obidos/tg/detail/-/0735613753/qid=
> 1075415896/sr=1-1/ref=sr_1_1/103-6891424-7657406?v=glance&s=books
>
> http://www.amazon.com/exec/obidos/tg/detail/-/0735620598/qid=
> 1075415896/sr=1-3/ref=sr_1_3/103-6891424-7657406?v=glance&s=books
They are really both the same book except that the "version 2003" is updated
for VS.NET 2003 (.NET Framework 1.1). The "Core reference" one refers to
VS.NET 2002 (.NET 1.0).
The 2003 version is only about $10 more (retail price anyways, which I paid
for mine because I needed it that day). You get a lot more in the 2003
version, it is well worth the extra coin. For example, there are about 3
new chapters (I am paraphrasing new material from the Introduction of the
2003 version: "PInvoke, COM Interop, COM+, remoting, code access security,
and Windows Forms applications over HTTP.")
Also the 2003 version comes with TWO e-books (previous version had only 1
e-book). The 2 e-books in the 2003 version are a complete e-book of the
book itself, and a complete e-book of "Programming Microsoft Visual Basic
6." The previous version only had the e-book for "Programming with
Microsoft Visual Basic 6" and did not come with an e-book of itself.
Again, the 2003 version is well worth the extra $10 and is obviously more
up-to-date (if you use .NET 1.1 - VS.NET 2003).
|
| |
|
| |
 |
Noid

|
Posted: Thu Jan 29 17:41:55 CST 2004 |
Top |
Visual Basic [VB] >> Looking for an intermediate/advanced VB .NET book that covers multithreading
"Da~One" <EMail@HideDomain.com> wrote in
news:EMail@HideDomain.com:
>> OK. Thank for the suggestion. Hopefully, there will be others.
>>
>> But, are you referring to "Programming Microsoft Visual Basic .NET
>> (Core Reference)" or "Programming Microsoft® Visual Basic® .NET
>> Version 2003". Both are by Balena?
>>
>> http://www.amazon.com/exec/obidos/tg/detail/-/0735613753/qid=
>> 1075415896/sr=1-1/ref=sr_1_1/103-6891424-7657406?v=glance&s=books
>>
>> http://www.amazon.com/exec/obidos/tg/detail/-/0735620598/qid=
>> 1075415896/sr=1-3/ref=sr_1_3/103-6891424-7657406?v=glance&s=books
>
> They are really both the same book except that the "version 2003" is
> updated for VS.NET 2003 (.NET Framework 1.1). The "Core reference"
> one refers to VS.NET 2002 (.NET 1.0).
>
> The 2003 version is only about $10 more (retail price anyways, which I
> paid for mine because I needed it that day). You get a lot more in
> the 2003 version, it is well worth the extra coin. For example, there
> are about 3 new chapters (I am paraphrasing new material from the
> Introduction of the 2003 version: "PInvoke, COM Interop, COM+,
> remoting, code access security, and Windows Forms applications over
> HTTP.")
>
> Also the 2003 version comes with TWO e-books (previous version had
> only 1 e-book). The 2 e-books in the 2003 version are a complete
> e-book of the book itself, and a complete e-book of "Programming
> Microsoft Visual Basic 6." The previous version only had the e-book
> for "Programming with Microsoft Visual Basic 6" and did not come with
> an e-book of itself.
>
> Again, the 2003 version is well worth the extra $10 and is obviously
> more up-to-date (if you use .NET 1.1 - VS.NET 2003).
>
Yes, I think I like the '2003 Version'. But, I think I'll wait a few
months to see if the price drops a bit.
Thanks for the suggestion and review.
Noid Droid
|
| |
|
| |
 |
| |
 |
Index ‹ Visual Studio ‹ Visual Basic [VB] |
- Next
- 1
- MFC >> CDC::TextOut (or ExtTextOut) background colour troublesHi. I'm displaying some text on a dialog.
CPaintDC dc(this);
dc.TextOut(rect.left,rect.top,"HELLO");
On initial drawing of the dialog, the text background is white. As soon as a
control is used, the text background goes grey. Any way to make this not
change (or set to one colour)?
- 2
- MFC >> Alternative to 'AfxSetResourceHandle'Hi.
I am localizing my application, and using 'AfxSetResourceHandle'
function in this way, to load the appropriate resource:
CMyApp::CMyApp()
{
switch (GetUserDefaultLangID())
{
case MAKELANGID(LANG_ARMENIAN, SUBLANG_DEFAULT):
ASSERT((m_hResLibrary =
LoadLibraryEx(TEXT("MyApphye.dll"), NULL,
LOAD_LIBRARY_AS_DATAFILE)) != NULL);
break;
case MAKELANGID(LANG_RUSSIAN, SUBLANG_DEFAULT):
ASSERT((m_hResLibrary =
LoadLibraryEx(TEXT("MyApprus.dll"), NULL,
LOAD_LIBRARY_AS_DATAFILE)) != NULL);
break;
}
}
BOOL CMyApp::InitInstance()
{
// Set the resource handle to the appropriate resource DLL
if (m_hResLibrary)
AfxSetResourceHandle(m_hResLibrary);
return CWinApp::InitInstance();
}
The problem is that most MFC member functions use
'AfxGetResourceHandle' function, to obtain the default resource
library. For example, 'CBitmap::LoadBitmap' doesn't have a parameter
for instance handle, it uses 'AfxFindResourceHandle'. So do most
members of other classes. It means, I must create the same bitmap in
any resource DLL I use, but I don't want to do that. I want to
translate only localizable resources, the rest ones must reside in the
EXE. Is it possible to do?
Thanks in advance
Martin
- 3
- MFC >> bug in Screen Saver Sample included in Visual C 6.0I'm trying to fix a bug in the Screen Saver sample in the Visual
Studio 6.0 suite. The following is a brief description of the bug:
When the program terminates CDrawWnd remains open. There remains
an empty window box in the task bar, for every instance of the terminated
program. The OnDestroy event occurs, even though the window doesn't
actually get destroyed. I have tried every way I can think of to
destroy the window manually, but to no avail.
Is there some special way to terminate a screen saver application that
I need to take into consideration?
Please try to e-mail me your replies, if you can.
Thanks,
Mikko Antero Gustafsson
mikko_gustafsson@hotmail.com
- 4
- VB Scripts >> Collect Item Return in diffrent order.Hello all,
I'm not the best programer in the world so I was wondering if I could get a
little help from you all. I'm using VBScript to make a WMI call to the event
viewer on a 2003 server. The return for the query is great... Code snip.
et colEvents = objWMIService.ExecQuery ("Select * from Win32_NTLogEvent
WHERE (Logfile = 'System') AND (EventCode = '6005'or EventCode = '6008' or
EventCode = '1074' or EventCode = '1076') AND (SourceName <> 'W3SVC')")
intCount = 0
For Each objService in ColEvents
if objService.EventCode = "6005" THEN
strboottime = objService.Timewritten
end if
if objService.EventCode = "1074" THEN
intCount = intCount + 1
strstoptime = objService.Timewritten
strdiff = ( DateDiff("s", WMIDateStringToDate(strstoptime),
WMIDateStringToDate(strboottime)) )
intdiff = intdiff + strdiff
WScript.Echo "Down For: " & SecondsToText(strdiff)
This returns....
Down For: 1 Minute, 7 Seconds
Down For: 1 Minute, 24 Seconds
Uptime Report For: CSCS-IT-007C
Microsoft Windows XP Professional 5.1.2600
Install Date: 12/06/2004 11:28:17
Last Reboot: 01/11/2005 18:03:23
Up For: 6 Days, 17 Hours, 45 Minutes, 9 Seconds
Total Reboots: 2
Total Down Time: 2 Minutes, 31 Seconds
So far so good, now I want to change how far back data is collection so I
mode the query to look for timewritten... code snip...
Set dtmStartDate = CreateObject("WbemScripting.SWbemDateTime")
DateToCheck = Date - 365
dtmStartDate.SetVarDate DateToCheck, True
Set dtmEndDate = CreateObject("WbemScripting.SWbemDateTime")
dtmEndDate.SetVarDate Date, True
WScript.Echo "Start Date: " & dtmStartDate & " End Date: " & dtmEndDate
Set colEvents = objWMIService.ExecQuery ("Select * from Win32_NTLogEvent
WHERE TimeWritten >= '"&dtmStartDate&"' AND Logfile = 'System' AND (EventCode
= '6005'or EventCode = '6008' or EventCode = '1074') AND SourceName <>
'W3SVC'")
The problem I have is the output order is diffrent. Instead of DESC it now
AESC. I have tried to add ORDER BY TimeWritten but I get an error. Any
insite on how to change the order would be very helpfull.
Thanks
David.
- 5
- 6
- 7
- Visual Basic >> Permission denied when trying to create Word objectHello,
I have some code that was running fine on NT, but I have since upgraded
(ie clean install) the machine to 2003 and am getting a permission
denied error when it hits the line ...
Set objWord = CreateObject("Word.Application")
I am running this from the VB IDe logged in as Administrator, so I'm not
sure what permissions I need to set. I thought I had permission to do
anything I liked !!
Using Word97 if that helps. TIA
--
Alan Silver
(anything added below this line is nothing to do with me)
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
- 8
- MFC >> opening a .pdf file...I have a dialog box with a button. In my button click handler I want
to open a .pdf file. What code would I write inside my handler
function to accomplish this?
Thanks,
RABMissouri2006
- 9
- Visual Basic [VB] >> printing a text file, printdocument1_printpage gets called TWICE for each page?!Ok, so this is driving me mad. For some reason, regardless of the
value of ev.hasmorepages, the printoducment1_printpage gets called
twice for every page. So, I print 2 pages of data on one page, with
the second overlaying the original data. If i set ev.hasmorepages to
false, essentially telling the printdocument to only print one page,
it prints one page, with two pages of data, because at the end of the
_printpage subroutine, even when ev.hasmorepages is false, it runs the
sub once more. Any help on this would be fantastic, below is my code:
Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object,
ByVal ev As System.Drawing.Printing.PrintPageEventArgs) Handles
PrintDocument1.PrintPage
Dim linesPerPage As Single = 0
Dim yPos As Single = 0
Dim count As Integer = 0
Dim leftMargin As Single = ev.MarginBounds.Left
Dim topMargin As Single = ev.MarginBounds.Top
Dim line As String = Nothing
'ev.HasMorePages = True
' Calculate the number of lines per page.
linesPerPage = (ev.MarginBounds.Height /
printFont.GetHeight(ev.Graphics)) - 1
' Print each line of the file.
'If counterx = False Then
While count < linesPerPage
line = streamtoprint.ReadLine()
If line Is Nothing Then
Exit While
End If
yPos = topMargin + count *
printFont.GetHeight(ev.Graphics)
ev.Graphics.DrawString(line, printFont, Brushes.Black,
leftMargin, yPos, New StringFormat())
count += 1
End While
'End If
'If counterx = False Then
'counterx = True
'ElseIf counterx = True Then
'counterx = False
'End If
' If more lines exist, print another page.
If (line IsNot Nothing) Then
ev.HasMorePages = True
Else
ev.HasMorePages = False
End If
End Sub
..........THIS IS WHAT CALLS THE PRINTPAGE....
streamtoprint = New IO.StreamReader("C:\temp.dat")
Try
printFont = New Font("Times New Roman", 10)
AddHandler PrintDocument1.PrintPage, AddressOf
Me.PrintDocument1_PrintPage
PrintDocument1.Print()
Finally
streamtoprint.Close()
IO.File.Delete("C:\temp.dat")
End Try
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Thanks everyone!
- 10
- Visual Basic [VB] >> mailer questionHello,
I made a mailer program from instructions I found on the web in vb2005.
It works, but doesn't seem to send the mail until I end the program.
Maybe there is some other command I need to get it to send?
Any help appreciated.
I know this is true, because my outgoing mail virus scan pops up when I
close the program, showing its scanning an outgoing email.
This doesn't happen till I end the program.
After that I get the message in my in box. Not while the program is up,
even though it says it sent.
Thanks.
Scott
Dim msg As New MailMessage("info@mysite.com", "scott@mysite.com")
msg.Subject = "My Email Subject"
msg.IsBodyHtml = True
msg.Body = "This is <i>the body</i> of the email message, it can also
contain HTML code in it"
Dim credential As Net.NetworkCredential = New Net.NetworkCredential
credential.UserName = "info@mysite.com"
credential.Password = "forward"
'Now we 've got everything we need to send the email except an SMTP server.
To create that just create a new instance of SmtpClient.
Dim client As New Net.Mail.SmtpClient()
'First we need to set up which SMTP server that the SMTP Client needs to use
client.Host = "mail.mysite.com"
client.UseDefaultCredentials = False
client.Credentials = credential
'client.EnableSsl = True
'The first line tells the SMTP client that we are supplying our own
credentials. The second line sets those credentials to the
NetworkCredentials we set up earlier. The third line tells the SmtpClient
that gmail uses SSL for authentication.
'Everything is ready to go now, all that is needed is to send the message.
Just call the send method supplying the MailMessage we created earlier.
client.Send(msg)
'client.SendAsync("scott@tryols.com", "scott@tyrols.com", "hi", "hi more",
"")
- 11
- Visual Studio C++ >> wsprintf?Having revisited some old code I am reminded of the existence of
wsprintf().
I vaguely remember from the old 16bit days that there was some
reason to prefer it over the standard C-library function sprintf(),
but I can't for the life of me remember what it was.
Does it have any advantages these days or is it just there for
legacy code?
Dave
--
David Webber
Author MOZART the music processor for Windows -
http://www.mozart.co.uk
For discussion/support see
http://www.mozart.co.uk/mzusers/mailinglist.htm
- 12
- Visual Basic >> Getting SSID with WMI in VB6 - NewbI was looking for ways to get the SSID of an active Wireless Connection.
I've seen no other ways except to access it through WMI.
I know nothing of WMI & I'm having little luck getting documentation or
finding out how to get at WMI in VB6.
I found this link: http://www.furrygoat.com/PermaLink.aspx?guid=000993
It supposedly is how to get the SSID with WMI in .NET.
Can any kind soul direct me on how to acheive this goal in VB6? All
machines will be XP if that helps at all.
Thanx in Advance
Snuffy2
- 13
- Visual Basic [VB] >> How to get control identification from (Sender as Object)Hi,
I have this event that is performed by three different controls, how can
I know (from sender object) wich control is used to trigger the event?
Private Sub HighlightSelectedRow(ByVal sender As Object, ByVal e As
System.EventArgs) Handles tbxAmount.Click, lblID.Click, lblExpense.Click
Dim ctlControl As System.Type
ctlControl = sender.GetType
'???
Select Case ctlControl
'???
End Select
End Sub
Thanks
Marty
- 14
- 15
- Visual Basic >> passing a textbox control in parameter listHi, I have an application that has about 3 subroutines that I'd like to use in another application so I decided to move them out into a DLL. Anyway, I moved them out and I call them from the two applications and they all work fine. When I moved them out, I temporarily commented out anything to do with the user interface - basically the routines do some processing of files that sometimes takes a long time so in the original application, the routines would update a little status form
What I'd like to do is popup the status form in each of the two applications and then call the subroutines in the DLL and then have the subroutine update the form. So I decided to add a simple textbox control in the subroutines' parameter list. When I go to compile the DLL I get
Compile error
Private object modules cannot be used in public object modules as parameters or return types for public procedures, as public data members, or as fields of public user defined type
This is the test subroutine that gives me the compile error
Public Sub test(t As Control
t.Text = "foobar
End Su
Am I stuck, am I doing something wrong? Is there a way around it? Any other suggestion of how to do what I'd like? Thanks
|
|
|