|
My apologies. You are correct. I tried your code.
Then I changed my function from
value = colordialog.color
ColorToInteger = value.ToArgb()
to
value = colordialog.color
dim x as integer = value.ToArgb()
and it works as well.
ColorToInteger = x <-- overflow
My problem was my Function was returning a UInteger (which is what I need), and that was causing the overflow.
I wonder if there's a way to convert the Integer to UInteger.
Paul Watson wrote:
Like, if you say sort of, like, you know, one more, you know, time, I'm going to, like, you know, sort of sort you out, you know.
|
|
|
|
|
Not is a useful sense. Negative Integers don't have a defined conversion to an Unsigned Integer. You can use the Convert class and it's ToUInt32 method, but it will throw an Overflow exception if the Int32 value is less than 0.
' This will bomb out...
Dim myUInt As UInt32 = Convert.ToUInt32(-400)
It can, however be done using two conversions and the BitConverter[^] class.
Dim bytes As Byte() = BitConverter.GetBytes(someInt32)
Dim myUInt32 As UInt32 = BitConverter.ToUInt32(bytes, 0)
But, like I said, this conversion doesn't have any defined meaning.
|
|
|
|
|
Thanks. I'll just stick to the long method (.R, .G, .B).
Paul Watson wrote:
Like, if you say sort of, like, you know, one more, you know, time, I'm going to, like, you know, sort of sort you out, you know.
|
|
|
|
|
Thomas Stockwell wrote: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
That's about right
Steve Jowett
-------------------------
Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'
|
|
|
|
|
Hi,
Background:
Plugin Application.
TestPlugin.exe file is loaded into the main program using reflection. (this works)
Main program calls "ShowConfig()" plugin function using reflection invoke(obj, args),
and the plugin displays the config window,
user sets his config, clicks OK, window disappears
showconfig() passes back a reference to the "TestConfigObj" in the args
TestConfigObj is also public inside the TestPlugin.exe assembly.
Looking at the "args(0)" - it correctly shows the TestConfigObj.myconfigvars
Main Test program now wishes to take a clone of this "object"
BUT
this code is throwing this exception when I try and clone the "object",
<br />
Function ObjectCopy(ByVal obj As Object, ByVal AssemblyFileName As String) As Object<br />
'copies original object to stream then <br />
'deserializes that stream and returns the output<br />
'to create clone (copy) of object<br />
<br />
Dim objMemStream As New MemoryStream(5000)<br />
Dim objBinaryFormatter As New BinaryFormatter(Nothing, _<br />
New StreamingContext(StreamingContextStates.Clone))<br />
<br />
' make sure our assembly is loaded!<br />
' System.Reflection.Assembly.LoadFile(AssemblyFileName)<br />
<br />
' output the object, reset pointer and input the object back again<br />
objBinaryFormatter.Serialize(objMemStream, obj) ' *** THIS LINE(1) IS OK - Mouse hover shows ME ASSEMBLY BREAKDOWN OF 'Obj'<br />
objMemStream.Seek(0, SeekOrigin.Begin)<br />
ObjectCopy = objBinaryFormatter.Deserialize(objMemStream) ' *** THIS LINE(2) THROWS UNKNOWN ASSEMBLY<br />
<br />
objMemStream.Close()<br />
end Function<br />
Exception:
<br />
System.Runtime.Serialization.SerializationException was unhandled<br />
Message="Unable to find assembly 'CTPTestDemo1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'."<br />
Source="mscorlib"<br />
StackTrace:<br />
at System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly()<br />
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAssemblyInfo assemblyInfo, String name)<br />
at System.Runtime.Serialization.Formatters.Binary.ObjectMap..ctor(String objectName, String[] <br />
...<br />
However, when I hover the mouse over line(1) 'obj' I get:
<br />
- obj | { CTPTestDemo1.TestConfigObj }<br />
- CTPTestDemo1.TestConfigObj | { CTPTestDemo1.TestConfigObj }<br />
- Iterations | 12345<br />
I have tried loading the CTPTestDemo1 assembly just before I serialize, but this doesn't work
(hence why I have commented it out again)
Why can the mouse hover give me the correct "TestConfigObj" details, and serialize it,
but can't deserialize it back into the new object?
I have gone through the GetReferencedAssemblies() but the CTPTestDemo assembled is not listed in this collection.
I also only have ONE version of the CTPTestDemo assmebly (.exe file)
I do not want to reference in the MainApps References the TestPlugin.Exe Assembly - as these are test Plugin's and so the mainapp should not need to know about them
Any Ideas would be greatfully received!
Thanks,
Phil.
|
|
|
|
|
Hi,my problem is my project was developed in asp.net with c# but my visual source safe schedular is working on windows.In vss i have all the document files,pdf files,excel files.It's starts working on everyday night 12.00am.so while schedular running time doc files,pdf files,excel files phisical path is converted to html path(/).So sometimes if any document file has any problem the vss is stopped upto that document afterthat it doesn't continue.So what i want is if any document file has problem then schedular ignores that document and it goes to next document.iam sending some classes in my vss.
<pre>
public function get vss connection()
Public Function PopulateProject() As Boolean
Private Function PopulateSubProject(ByVal sParent As String, ByVal ItemIsDeleted As Boolean) As Boolean
Private Function Traverse(ByVal sProjectPath As String, ByVal SWFPath As String)
Private Function PopulateFiles(ByVal sParentID As Long, ByVal sProjectPath As String, ByVal sFolderPath As String) As Boolean
Private Sub InsertMenuRights()
Private Sub InsertDocNames()
Private Sub CreateFolder(ByVal Path As String)
Private Function GetNWExt(ByVal FileName As String) As String
Public Sub Conversion()
Private Function GetHTMLPath(ByVal FilePath As String)
Private Sub DocToHTML(ByVal FilePath As String, ByVal HTMLPath As String)
Private Sub PptToHTML(ByVal FilePath As String, ByVal HTMLPath As String)
Private Sub PDFToHTML(ByVal FilePath As String, ByVal HTMLPath As String)
Private Sub ExcelToHTML(ByVal FilePath As String, ByVal HTMLPath As String)
Private Function GetTPath(ByVal DocPath As String)
Private Function GetTruncPath(ByVal HTMPath As String)
</pre>
samrama
|
|
|
|
|
Is there a particular reason you posted the same question four times today? Do you think that will get people to help you?
______________________
stuff + cats = awesome
|
|
|
|
|
leckey wrote: stuff + cats = awesome
I don't know why but I read that as "stuffed cats = awesome"
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Never write for other people. Write for yourself, because you have a passion for it. -- Marc Clifton
My website
|
|
|
|
|
Ah, that would not be the same thing! (It's from stuffonmycat.com.) I did want to taxidermy my cat Boomer when he dies, but now I'm trying to convince my husband to clone him.
______________________
stuff + cats = awesome
|
|
|
|
|
Hi,my problem is my project was developed in asp.net with c# but my visual source safe schedular is working on windows.In vss i have all the document files,pdf files,excel files.It's starts working on everyday night 12.00am.so while schedular running time doc files,pdf files,excel files phisical path is converted to html path(/).So sometimes if any document file has any problem the is stopped upto that document afterthat it doesn't continue.So what i want is if any document file has problem then schedular ignores that document and it goes to next document.iam sending some classes in my vss.
<pre>
public function get vss connection()
Public Function PopulateProject() As Boolean
Private Function PopulateSubProject(ByVal sParent As String, ByVal ItemIsDeleted As Boolean) As Boolean
Private Function Traverse(ByVal sProjectPath As String, ByVal SWFPath As String)
Private Function PopulateFiles(ByVal sParentID As Long, ByVal sProjectPath As String, ByVal sFolderPath As String) As Boolean
Private Sub InsertMenuRights()
Private Sub InsertDocNames()
Private Sub CreateFolder(ByVal Path As String)
Private Function GetNWExt(ByVal FileName As String) As String
Public Sub Conversion()
Private Function GetHTMLPath(ByVal FilePath As String)
Private Sub DocToHTML(ByVal FilePath As String, ByVal HTMLPath As String)
Private Sub PptToHTML(ByVal FilePath As String, ByVal HTMLPath As String)
Private Sub PDFToHTML(ByVal FilePath As String, ByVal HTMLPath As String)
Private Sub ExcelToHTML(ByVal FilePath As String, ByVal HTMLPath As String)
Private Function GetTPath(ByVal DocPath As String)
Private Function GetTruncPath(ByVal HTMPath As String)
</pre>
samrama
|
|
|
|
|
Hi,my problem is my project was developed in asp.net with c# but my visual source safe schedular is working on windows.In vss i have all the document files,pdf files,excel files.It's starts working on everyday night 12.00am.so while schedular running time doc files,pdf files,excel files phisical path is converted to html path(/).So sometimes if any document file has any problem the is stopped upto that document afterthat it doesn't continue.So what i want is if any document file has problem then schedular ignores that document and it goes to next document.iam sending some classes in my vss.
<pre>
public function get vss connection()
Public Function PopulateProject() As Boolean
Private Function PopulateSubProject(ByVal sParent As String, ByVal ItemIsDeleted As Boolean) As Boolean
Private Function Traverse(ByVal sProjectPath As String, ByVal SWFPath As String)
Private Function PopulateFiles(ByVal sParentID As Long, ByVal sProjectPath As String, ByVal sFolderPath As String) As Boolean
Private Sub InsertMenuRights()
Private Sub InsertDocNames()
Private Sub CreateFolder(ByVal Path As String)
Private Function GetNWExt(ByVal FileName As String) As String
Public Sub Conversion()
Private Function GetHTMLPath(ByVal FilePath As String)
Private Sub DocToHTML(ByVal FilePath As String, ByVal HTMLPath As String)
Private Sub PptToHTML(ByVal FilePath As String, ByVal HTMLPath As String)
Private Sub PDFToHTML(ByVal FilePath As String, ByVal HTMLPath As String)
Private Sub ExcelToHTML(ByVal FilePath As String, ByVal HTMLPath As String)
Private Function GetTPath(ByVal DocPath As String)
Private Function GetTruncPath(ByVal HTMPath As String)
</pre>
samrama
|
|
|
|
|
You had already asked the same question 6 hours back and when someone knows the answer to it, they will answer. Delete your duplicate posts.
|
|
|
|
|
Hi,
I need to create a path for where my XML needs to be saved, but I need to get the path where the web files are saved on the server. In classic ASP I think I used Server.MapPath or something like that. The reason why I don't want to hard code is because certain hosting companies save the website on the C: drive, or f: Drive, etc.
Please can someone help? I'm using VB.NET 1.1.
Regards
ma se
|
|
|
|
|
hi,
the same works in asp.net as well
if it is a windows application use: "Application.StartupPath"
regards
|
|
|
|
|
It's a web application, how would I do it now??
|
|
|
|
|
System.AppDomain.CurrentDomain.BaseDirectory.ToString
Steve Jowett
-------------------------
Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'
|
|
|
|
|
Hi,
If I take a combobox on form, what I want is I want to store data selected from combobox to database. Take for example.
Combobox has 3 options-->>1)Mr. 2)Mrs. 3)Miss
Now what I want is if i select any one option from this it should
be stored in my data base(Access).
How to write a query for this, which event i should take on combobox.
Do I need 2 tables for this. I mean one for their details and one for Mr.,Mrs,Miss
Please solve my query
-- modified at 7:45 Tuesday 12th June, 2007
Nitin Jenwal
|
|
|
|
|
You can handle a selected index changed event. How you handle it depends on if you want to write your record again for every field that changes, or if you want a save button.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
i'm using vb.net to develop a system, and need to create chart(histogram/graph). Value should get from my database. But i dun have any idea on how to call out the value from the database to the chart..
anybody an idea on this?
thousand thanks for your help..
|
|
|
|
|
What's generating the chart ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
in my project is asp.net with c# project but my vss schedular is asp.net with vb.net.
Every this schedular is running on night 12.00am .
In that schedular i have somany doc files and excel files,.pdf files.
So while schedular running time html paths and actual document paths but some times it automatically stopped then i want do if any document contains problem then schedular ignore's that document and goes to next document.For this i want code. Iam sending some of the classes of the my project.
<pre>
public function get vss connection()
Public Function PopulateProject() As Boolean
Private Function PopulateSubProject(ByVal sParent As String, ByVal ItemIsDeleted As Boolean) As Boolean
Private Function Traverse(ByVal sProjectPath As String, ByVal SWFPath As String)
Private Function PopulateFiles(ByVal sParentID As Long, ByVal sProjectPath As String, ByVal sFolderPath As String) As Boolean
Private Sub InsertMenuRights()
Private Sub InsertDocNames()
Private Sub CreateFolder(ByVal Path As String)
Private Function GetNWExt(ByVal FileName As String) As String
Public Sub Conversion()
Private Function GetHTMLPath(ByVal FilePath As String)
Private Sub DocToHTML(ByVal FilePath As String, ByVal HTMLPath As String)
Private Sub PptToHTML(ByVal FilePath As String, ByVal HTMLPath As String)
Private Sub PDFToHTML(ByVal FilePath As String, ByVal HTMLPath As String)
Private Sub ExcelToHTML(ByVal FilePath As String, ByVal HTMLPath As String)
Private Function GetTPath(ByVal DocPath As String)
Private Function GetTruncPath(ByVal HTMPath As String)
where i will mention code in this classes.Please help me.
</pre>
samrama
|
|
|
|
|
hello all,
IS IT posible in vb.net to create a program that execute a command to TURN ON THE PC ON A SPECIFIC TIME??
i am using vb.net 2.0
hope anyone could help me!
any Code ???? Link ???
THANKS!
koolprasad2003
If the message is useful for U then please Rate This message...
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
Yes, it's possible, but only if the mother board supports it. Unless the mother board is willing to turn itself on, it's not really possible. Doing it via VB.NET will only work if the code is running on another machine, and the machine being switched on has mother board features that your code can access.
Unless your code drives a robot that pushes the power button.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thankx Christian ,
Thankx a lot,
can u give me code sample or any useful links ???
regards,
koolprasad2003
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
Some motherboards have wake on LAN, I'd expect those can be started with LAN activity. No, I have no code, I think it's a wild goose chase in most cases.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|