|
VB6 doesn't return the time using a milliseconds field, so you'll have to call into the Win32 API to get the time.
GetLocalTime[^] will get the system time in the local timezone.
GetSystemTime[^] will return the system time in UTC.
Both of these functions will require you to pass in a SYSTEMTIME[^] structure (ByRef) to get the time out of the function. The actual return value will tell you if the call failed or not.
The declare for both functions:
Declare Sub GetLocalTime Lib "kernel32" Alias "GetLocalTime" (lpSystemTime As SYSTEMTIME)
Declare Sub GetSystemTime Lib "kernel32" Alias "GetSystemTime" (lpSystemTime As SYSTEMTIME)
Private Type SYSTEMTIME
wYear As Integer
wMonth As Integer
wDayOfWeek As Integer
wDay As Integer
wHour As Integer
wMinute As Integer
wSecond As Integer
wMilliseconds As Integer
End Type
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
So I presume then that to get the SYSTEMTIME structure into the 8-byte data type, I will have to convert the SYSTEMTIME structure to a FILETIME structure and then convert that into the 8-byte data type that I wish to use. Is that correct?
|
|
|
|
|
That's right. Now all you have to do is make sure that the receiving system gets the bytes in the right order.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Can anyone explain to me, What I need to do to create a data dictionary? The following is from the help section of Advantage. I don't know how to implement this into VB.Net code in my ASP.Net project.
Creates a data dictionary.<br />
<br />
Syntax<br />
UNSIGNED32 AdsDDCreate( UNSIGNED8 *pucDictionaryPath,<br />
UNSIGNED16 usEncrypt,<br />
UNSIGNED8 *pucDescription,<br />
ADSHANDLE *phAdminConn );<br />
<br />
Parameters<br />
pucDictonaryPath (I) Full file path of the data dictionary to create. <br />
<br />
usEncrypt (I) A non-zero value will cause the data dictionary data<br />
file to be encrypted.<br />
<br />
pucDescription (I) An optional description of the database in the data <br />
dictionary. If NULL, no database description is <br />
stored in the data dictionary. The database<br />
description can be added or changed later with <br />
AdsDDSetDatabaseProperty.<br />
<br />
phAdminConn (O) Returns a database administrative connection handle <br />
if the data dictionary is created successfully.<br />
<br />
Example:<br />
Create a data dictionary without encrypting the data dictionary data files, and then add a table to the database.<br />
<br />
AdsDDCreate( "n:\\MyData\\myData.ADD", 0, "This is the database of my tables and indexes.", &hDD );<br />
AdsDDAddTable( hDD, "Customer Information", "n:\\MyData\\customer.ADT", ADS_ADT, "customer.adi;customer2.adi",<br />
"This table contains information on all customers." )
Thanks in advance.
Beginner in VB and ASP.Net
|
|
|
|
|
hi
i am writing an application which maintains records of several clients. Each client has different settings. This is maintained in a XML file. When the user wants to update the data of a particular client changes have for that client.
this is what my XML document looks like.
<?xml version="1.0" encoding="UTF-8"?>
<config>
<client name="Cadbury">
<mcastg>222.23.342.1</mcastg>
<port>2222</port>
<path>c:\</path>
<repeat>4</repeat>
<spawn>4</spawn>
<ttl />
<profile>Custom</profile>
<custom>
<bw>1200</bw>
<dgsize>1024</dgsize>
</custom>
</client>
<client name="dabur">
<mcastg>222.23.432.23</mcastg>
<port>3333</port>
<path>d:\</path>
<repeat>5</repeat>
<spawn>5</spawn>
<ttl>4</ttl>
<profile>High</profile>
<custom>
<bw />
<dgsize />
</custom>
</client>
<client name="Vineet Inc">
<mcastg>222.23.43.4323</mcastg>
<port>5555</port>
<path>e:\</path>
<repeat>10</repeat>
<spawn>1</spawn>
<ttl>4</ttl>
<profile>Low</profile>
<custom>
<bw />
<dgsize />
</custom>
</client>
<client name="ICICI">
<mcastg>223.533.456.234</mcastg>
<port>54334</port>
<path>e:\hello</path>
<repeat>10</repeat>
<spawn>45</spawn>
<ttl>4</ttl>
<profile>Low</profile>
<custom>
<bw />
<dgsize />
</custom>
</client>
<client name="Vikram">
<mcastg>223.533.456.234</mcastg>
<port>5433</port>
<path>d:\vineet</path>
<repeat>10</repeat>
<spawn>45</spawn>
<ttl>4</ttl>
<profile>High</profile>
<custom>
<bw />
<dgsize />
</custom>
</client>
</config>
say i want to edit the settings for ICICI, how do i do from within the executing program. please give proper code.
Thanks
|
|
|
|
|
Dim ds As New DataSet
Private Sub btnGetData_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGetData.Click
ds = New DataSet
ds.ReadXml("c:\test.xml")
DataGrid1.DataSource = ds
End Sub
Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Click
ds.WriteXml("c:\test.xml")
End Sub
|
|
|
|
|
thanks this worked for me
but only one thing, can i do this without the DataGrid. i know it is a bit more complicated but that would be really better
|
|
|
|
|
Hi there
I have a datagrid (with tablestyle-created from the properties window - winform) in my app that I need to format a certain way.
I need to be able to change the or highlight a row color or text if that row contains certain information. For example:
I have a grid that looks like this
ID | Item1 | Item2 | Item3 | Authors
01 | info1 |infor2 | info3 | name1
02 | info1 |infor2 | info3 | John Henry
03 | info1 |infor2 | info3 | name1
What I want to do is highlight or change the row color every where in the datagrid that the Author John Henry appears
Any help?
|
|
|
|
|
|
Try putting this in there. It's pretty flexible. The Cells index is zero based.
Private Sub MyDataGrid_ItemDataBound(ByVal sender As Object, ByVal e As DataGridItemEventArgs) Handles MyDataGrid.ItemDataBound
If e.Item.Cells(4).Text.ToString.Trim = "John Henry" Then
e.Item.Cells(4).BackColor = Color.Yellow
e.Item.Cells(4).ForeColor = Color.Blue
End If
End Sub
|
|
|
|
|
Hello,
Does anyone know how to format a particular column in Excel to an accounting style?
Here's my situation, I created a Excel accounting report in a VB.Net application, but I'm not sure how to format certain columns to the different styles for example, accounting or currency. How is this done in the VB code?
Thanks!
|
|
|
|
|
Hello Sir,
I wanna hide my vb application from the task manager. My application is in startup so when I restart the machine anybody can close it from task list before the OS is started. so it could not come on desk top any more.
Best regards
M urtuza Patel
|
|
|
|
|
Simple. You can't. Even the system processes show up in the TM...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I think no way to do that
I Believe I Can fly!~~~
|
|
|
|
|
Hello Sir,
I wanna hide my vb application from the task manager. My application is in startup so when I restart the machine anybody can close it from task list before the OS is started. so it could not come on desk top any more.
Best regards
M urtuza Patel
|
|
|
|
|
IIRC, you can't.
You could rewrite it as a Windows Service, but that still won't hide it from the Windows Task Manager, although it will appear in the Processes tab rather than the Applications tab. Also, a Windows Service can still be shut down by the user through the Task Manager (which is not recommended) or via the Services management console (in Administrative Tools-->Services).
Does this help?
To my mind it is also highly suspicious that there is a valid reason why a process absolutely must remain active and should never be shut down unless it is an integral part of the operating system.
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
|
|
|
|
|
It is possible with the help of API but
with the perfect API u can hide the Apps from Task manager
but sorry i dont know the code...
But it is possible
|
|
|
|
|
I want to create a program that will intercept a file download, and compare it to a database of files i already have. I am not looking for someone to code this for me, just an idea of were to start. TIA!!!
|
|
|
|
|
What do you mean by "intercept"? If you are looking to do this inside of IE, you'll want to check out Browser Helper Objects (warning: Lots of COM Interop involved). You won't be able to see the actual download itself, but you'll be able to see the link that is clicked on and use that instead.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Do you mean that the file name that you already download is record into the database? In my opinion, when you click on the hyperlink in the browser just copy the URL in one variable. After you complete its download, you need to pass the string from variable to database. If you did not download complete, the variable is cleared, your database has no new record and next time you have to download it from the beginner again. If you download the same file then it will check the database to make sure that it might duplicate or not.
Roath Kanel
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
Hi
Now I try to work with C#. My application had to process an *.xml file through Excel COM. Cause of I use native Excel help for VBA : “VBAXL9.CHM” .But there is any troubles .When C# generate proxy for excel object it not consider about optional argument and cause of I should explicit pass this arguments every time in methods call. In many places into excel help referenced behavior of an methods with parameters by default (optional parameters which omit), but I don’t know what it are.
Where I can learn about definition of this defaults parameters????
|
|
|
|
|
You questions concerning C# would be better handled in the C# Forum.
C# doesn't support optional parameters so, you actually have to pass in a value called Type.Missing . See this[^] document on MSDN for some explanations.
This is not a problem in VB.NET.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Is there any way to add right click menu
(adding extra menu item to launch my app)
on mail. I hope this can be easily by
adding a key in the registry.
Van
|
|
|
|
|
What do you mean by "on mail"? Are you looking to add a shortcut to the Explorer Shell Context Menu, like WinZip does?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
If your looking to do it inside Outlook, it's hardly easy. Now your looking at a big can of COM Interop.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|