|
My apologies, Convert only converts from one base to another as an integer i.e. the ToInt16, ToInt32 or ToByte Functions have the fromBase Overload.
|
|
|
|
|
|
Each digit, counting from right to left, is a multiple of 16 to the power of that digit's position. So counting digits of the number 0x1234 as position 3210 for example we have
1 * 16^3 + 2 * 16^2 + 3 * 16^1 + 4 * 16^0 or
1 * 4096 + 2 * 256 + 3 * 16 + 4 * 1 etc
and your value 0x10 = 1 * 16^1 + 0 * 16^0 = 1 * 16 + 0 = 16txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
Thank u every body. If you can think then I Can.
|
|
|
|
|
If you remove the "0x" from the front of your string you can then use Int32 to parse it to an integer:
Dim str1 = "0x10"
Dim str2 = str1.Substring(2)
Dim i = Int32.Parse(str2, Globalization.NumberStyles.AllowHexSpecifier)
MsgBox("i = " & i)
Shows i = 16.
|
|
|
|
|
Hi,
So I have a column of cells that are the combination of a other cells in the row and a result of a few "if functions." The value comes out exactly as planned however in order for the data to be sent to the DDE server I need to press F2, go the beginning of the cell to insert an "=" sign and then press enter. I would like a macro to do what I just mentioned and then go down to the cell in the column. I used to write code using C++, but I'm a little rusty and unfamiliar with VB. Below is the formula and then the result of the cell. Any information or suggestions would be greatly appreciated!
=(IF(G10>0,"=ANVDdeSrv|"&B10&"!SendOrder"&L10&"NYSE_"&ABS(G10)&"_1_100_"&M10,IF(G10<0,"=ANVDdeSrv|"&B10&"!SendOrder"&L10&"NYSE_"&ABS(G10)&"_1_100_"&N10,)))
ANVDdeSrv|AMD!SendOrder_Sell_NYSE_300_1_100_3.3
|
|
|
|
|
Turn on macro recording, perform the actions, turn off macro recording and Robert is your father's brother.
|
|
|
|
|
Hello Fellow Programmers,
I have a treeview with treenodes holding an object.
When the Treeview is closed I wan't to properly dispose all objects inside all Treenodes.
The memory usage keeps growing.
I've added the dispose interface but I don't know how to trigger the event.
There is no event inside a treenode class that is triggert when the treeview is closed.
Or is there?
Public Class MenuTreeNode
Inherits TreeNode
Implements IDisposable
private m_Menu as menu
end class
I solved the problem to add the dispose handler from all treenodes to the treeview.HandleDestroyed event
All treenodes are now cleaned up when the handle is Destroyed.
Is this a good approach?
Thanks in Advancemodified on Tuesday, February 23, 2010 2:47 AM
|
|
|
|
|
Are you disposing of objects when the TreeNode is collapsed or you're trying to dispose of them when the TreeView goes out of scope when the Form it's on dies?
|
|
|
|
|
Dave,
I'm disposing the objects when the form is disposing and the treeview goes out of scope.
|
|
|
|
|
Do any of your custom TreeNode objects hold onto unmanaged resources??
Right now, i don't see why you implemented Dispose on a TreeNode object. Why did you think you needed to do this?
|
|
|
|
|
I don't use unmanaged resources in my custom treenodes
I think you meen that the garbage collector will cleanup the memory.
Even the extra objects that are declared inside the treenode.
I just wanted to make sure that all objects in the treenodes
are disposed before closing the treeview.
|
|
|
|
|
andre de jong wrote: I think you meen that the garbage collector will cleanup the memory.
Even the extra objects that are declared inside the treenode.
If they are managed objects (.NET code,) yes, it will.
andre de jong wrote: I just wanted to make sure that all objects in the treenodes
are disposed before closing the treeview
They'll be disposed and unusable, but they won't be destroyed until the GC gets around to collecting them.
Again, what makes you think you need to do this?
|
|
|
|
|
optimize garbage collection
|
|
|
|
|
You're actually hurting it, not optimizing it.
The Dispose method does NOT determine when the GC collects an object and frees memory. All Dispose does is give your object a chance to release resources that the GC cannot do itself, such as releaseing unmanaged handles to GDI objects, unmanaged memory allocations, ... Dispose does NOT in any way determine when an object is collected and its memory returned to the managed heap.
Again, why are you doing this? What makes you think you need to "optimize" garbage collection?
|
|
|
|
|
hello all
how can i check that sqlserver is install in server or not??? i create a setup file that install msde. and i want if sql is installed in system msde not install...
can you help me please?M.Alizadeh
modified on Tuesday, February 23, 2010 3:06 AM
|
|
|
|
|
Check if SQL Server exists in the computer services.
|
|
|
|
|
MSDE!? not SQL Server Express?
For MSDE have a look at SQLDMO.DLL. If you are using Express then look at the SMO library, which is the .NET replacement for SQLDMOSteve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
I'd like to start learning programming, which language should I start with for a beginner like me?
neothematrix
|
|
|
|
|
I doubt this was the right place to post this question - but I would say Visual Basic or C# would be the easiest to learn. Java would also be good to learn as it is multi-platform. If you want to fully understand computing languages though, learn C++ (or C). Its a more difficult language, but much more powerful, and if you can understand that language, other languages like VB and Java will make more sense. I started off learning VB6 and while I learned that quickly, when I started trying to learn C I was really confused!
|
|
|
|
|
Thank you. What do you think about Visual Basic Express Edition vs Visual Basic 6.0?
|
|
|
|
|
don't do VB6, it is ancient and obsolete. Choose:
- C# or Java for high-end applications (GUI apps, console apps, server apps, ...);
- C or C++ for low-level and system-oriented stuff (e.g. Windows drivers);
- whatever is required, if you choose a specific platform (e.g. Objective C for iPhone);
- VB.NET if you must.
If a Windows PC is your first environment, I strongly suggest you start with C# (the basic stuff, i.e. up to C# 2.0; no need to go 3.0). And yes, all Visual Studio Express Editions are fine for starters.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
|
|
|
|
|
Very good. I thank you very much for the suggestions, let me get started. I'll keep posting.
neothematrix
|
|
|
|
|
C# is definitely a good one to learn on if you are working on a Windows PC. You can download Visual C# 2008 Expression edition from Microsoft's web site.
|
|
|
|
|
Hello,
(This applies to C# as well)
I am building a tool using .Net remoting. If I obtain a proxy by Activator.GetObject and then want to switch that proxy by calling Activator.GetObject again with a different parameter - and I do this on a separate thread than the thread(s) that is/are using that proxy, could I run in to trouble? Right now I am using a SyncLock, but there could be several threads using this object, so each one has to wait its turn - even though the server code can handle several asynchronous calls just fine. Could I remove the SyncLocks with no worries?
If you need a little more explanation:
There will be several servers in different locations running the server code via a Windows service. These services may go down, start up, stop working, etc., so my client code may need to switch where it gets the proxy from. I have a separate thread that monitors these servers and tries to maintain the best connection. I want to know if there is a problem if a thread starts using the proxy, and then the connection thread switches the proxy. I assumed there was a problem so I used SyncLocks, which is also causing problems, so if possible, I want to remove the SyncLocks.
Thanks,
Kevin
|
|
|
|