|
VB (6 at least - not sure about .NET) uses BSTRs to handle strings, which are always two bytes / char (AKAIK), with a couple at the front end for length...
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
All Strings in the .NET Framework are Unicode strings. They all have double-byte characters, so yes, "123" will return 6 bytes.
You can't have two different encodings in the same string. It's either going to be all single-byte, or all double-byte, not both...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I'm developing a simple scheduler application for my company in VB.NET (Windows Forms).
(No, I can't use a standard product due to reasons I can't go into here)
Anybody have any sample code or simple framework which can help me getting started so I don't have to start from scratch ?
I'm looking for some simple code which shows how to make different schedules (every hour/day/week/month/date, on fixed times/dates, etc)
I of course know how to make timers, services, execute stuff, UI, and the rest of the application - only need help for the shedule checking part.
Maybe some kind of simple class library...
TIA
/B
|
|
|
|
|
A simple search on Google for "Scheduler source code" revealed tons of examples:
Google search results[^]
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Ever seen the tab control on Windows messenger? I know that it is actually a web page but I got the idea of somehow turning it into a windows forms control. However, I got into a snag custom drawing the tabcontrol. I can't seem to resize it so that it has space to display an icon instead of text nor can I custom draw the tab itself, just the same old boring rectangle - not the cool, new curved tabs like messenger. Any ideas?
|
|
|
|
|
Hi
Is there a function that let me create a shortcut to an app?
say on the desktop?
Thanks
|
|
|
|
|
There is no function in the .NET BCL that will handle this. You will have to use the Microsoft Scripting Runtime (set a COM reference to this!), create a Windows Scripting Shell object and use it to create the shortcut. Something like this (I think!):
Dim WshShell As New WScript.Shell
Dim oShellLink As WScript.Shortcut = WshShell.CreateShortcut(strDesktopPath & "\Shortcut Script.lnk")
oShellLink.TargetPath = WScript.ScriptFullName
oShellLink.WindowStyle = 1
oShellLink.Hotkey = "CTRL+SHIFT+F"
oShellLink.IconLocation = "notepad.exe, 0"
oShellLink.Description = "Shortcut Script"
oShellLink.WorkingDirectory = strDesktop
oShellLink.Save
I haven't tested this code, but it should look SOMETHING like this. I don't have Visual Studio where I'm at work, so I would have to wait until I got home to create a runnable example.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
See if you can consider creating shortcut at the time of deployment wherever you need using Setup projects. I suppose, this would be the best .NET solution.
BK
|
|
|
|
|
Hi
Im writing a app and I have a problem. I want my app will add one menuitem on menu system of Window???
Example::: When I open Window Explorer, click right mouse button on a folder, will appear one menupopup of window. I want on that menu will contain my menuitem. Its the same as Winzip application. Winzip has one menuitem on menu system of Window after you installed winzip...
Who can help me????
Thanks
Good luck
tramdtt
|
|
|
|
|
You'd have to associate your application with windows as being able to handle that particular file type. You'd have to be able to get the ProgID of your application then add that ProgID to the registry.
Your App's ProgID
HKEY_CLASSES_ROOT\Your_App
Default=Your App Name
\curver
Default=Your_Company.Your_App.Version
friendlyname=@Your_App
\shell\open\Command
Default=%Path to your App%\Your_App.exe %1
Then place something like this into
HKEY_CLASSES_ROOT\*.Your_App_File_Type
Default=Your_Company.Your_App.Version
Or if you want to handle folder types, look for the '*' filetype. If your really curious, you can find the Winzip registry entries there too.
Phew!!! There must be an easier way!!! If you find it, find me!!!
|
|
|
|
|
Before you tackle adding items to the Shell Context Menu, you might want to read Creating Context Menu Handlers[^] on MSDN. There are links in that article going to other pages that give additional background information that you will probably have to follow in order to completely grasp what is going on and why.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
Can anybody tell me How to find some application is running in system tray or not using Visual Basic.
I want to know only the appliction running in system tray not all the processes running in system.
So, if some specified application is running in system tray i need to close it. So how can i achieve this using vb6.
Thanking you all
Praveen
|
|
|
|
|
pampatipraveen wrote:
I want to know only the appliction running in system tray not all the processes running in system.
There is no difference between the two. They are both normal processes. The icon in the Tray is controlled entirely by the application. You'll still have to iterate through the entire process list to find the processes your looking for and then close them.
TaskList in VB6[^]
Once you have the app you're trying to close, then closing it is a whole other matter. You must take care when closing an app. It's not as easy as it may sound...
Kill An App Gently[^]
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
In side of my application i am launching outlookexpress
with email address and subject line with content. in the content
i want to have hyperlink text just you can do "insert->hyperlink" in
outlookexpress
str_Temp = mailto:info@mydomain.com?&Subject="hello"&body="click here"
ShellExecute Me.hWnd, "open", str_Temp, vbNull, vbNull, SW_SHOWNORMAL
I want to have Click here as hyperlink not just text line.
I tried to put click here for the body
but when i launch outlookexpress, content is only text.
I don't know how can i achieve this.
Thanks in advance
shin
|
|
|
|
|
This is the stupidest question. I'm quite new to VB, and i'm trying to find out what is the escape character.
For example, I am trying to do the following:
Formula = "This is a "STRING" inside a string"
How can I make it so that the " chars are escaped in the center part.
In C/C++/C#, i can escape with \
Thanks in advance,
Jon
|
|
|
|
|
Put two quote marks together. There is no escape character in VB...
Dim formula As String
formula = "This is a ""STRING"" inside a string"
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Another way to do that would be to use the ChrW() function. 34 is the Char number of the quote, so you could say,
Dim Formula As String = "This is a " & ChrW(34) & "STRING" & ChrW(34) & " inside as string"
Aaron Eldreth
TheCollective4.com
My Articles
While much is too strange to be believed,
Nothing is too strange to have happened.
- T. Hardy
|
|
|
|
|
You could... but which way is less typing and, therefore, less prone to errors?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks guys, both methods worked.
In fact, i read up on the CHR(34) method... and thats what I used.
What is the difference with CHR and CHRW?
Here was my final result:
Formula = "=IF(A" & RowPtr & "=" & Chr(34) & Chr(34) & "," & Chr(34) & Chr(34) & ",E5)"
Pretty ugly looking code. I think VB should consider an escape char in the next release
|
|
|
|
|
This is taken straight out of the MSDN documentation:
Public Function Chr(ByVal CharCode As Integer) As Char
Public Function ChrW(ByVal CharCode As Integer) As Char
Chr uses the Encoding class in the System.Text namespace to determine if the current thread is using a single-byte character set (SBCS) or a double-byte character set (DBCS). It then takes CharCode as a code point in the appropriate set. The range can be 0 through 255 for SBCS characters and -32768 through 65535 for DBCS characters. The returned character depends on the code page for the current thread, which is contained in the ANSICodePage property of the TextInfo class. TextInfo.ANSICodePage can be obtained by specifying System.Globalization.CultureInfo.CurrentCulture.TextInfo.ANSICodePage .
ChrW takes CharCode as a Unicode code point. The range is independent of the culture and code page settings for the current thread. Values from -32768 through -1 are treated the same as values in the range +32768 through +65535.
Numbers from 0 through 31 are the same as standard, nonprintable ASCII codes. For example, Chr(10) returns a linefeed character.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
have some xml document describing our database.
I have an element
in side of that document for empty element, but
when I parse it using DOM in VB
For Each rowElement In xmlDoc.documentElement.childnodes
str_content = rowElement.childnodes(0).nodeValue
Next
when I have NULL in the element I have application error
said "NULL is not properly used". I tried to filter the
NULL by
If rowElement.childnodes(0).nodeValue = NULL then
....
however, vb doesn't recognize this null
do you think i should not use
for empty element in the first place?
there is another solution?
Thanks for help
shin
|
|
|
|
|
If I read the documentation correctly, the only way you can have a null value for a CDATA section is if it looks like this:
<![CDATA[]]>
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
I found some software that can get the computer id. I'm doing a project that needs to get the computer id for security. Could somebody help me and show me how to get computer id in vb.net?
Thanks a bunch.
John
|
|
|
|
|
I take it your looking for the ComputerName, or NETBIOS Name, of the computer?
You can get that from the Environment.MachineName property.
Dim compName As String = Environment.MachineName
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|