|
'UPGRADE_WARNING: TypeOf has a new behavior. Click for more: 'ms-help:
ElseIf TypeOf cnt Is System.Windows.Forms.Timer Then<br />
nType = 0 'UPGRADE_WARNING: TypeOf has a new behavior. Click for more: 'ms-help:
ElseIf TypeOf cnt Is System.Windows.Forms.ToolStripMenuItem Then <br />
nType = 0
after Upgradation to VB.Net it complains like this
Error 146 Expression of type 'System.Windows.Forms.Control' can never be of type 'System.Windows.Forms.Timer'. <br />
<br />
Error 147 Expression of type 'System.Windows.Forms.Control' can never be of type 'System.Windows.Forms.ToolStripMenuItem'.
how can i resolve those issues please help needed
|
|
|
|
|
A timer is not a control. You need to rewrite your code.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
how can i re write the same code for the timer and toolstripmenuitem
please let me know
|
|
|
|
|
The code that uses a timer will need to be completely rewritten to use a .NET timer class. There's no simple way that I can see, a timer and a toolstripitem simply do not have a common base class in .NET.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
In my VB6 project
the declaration is like
Dim objDecrpt As New Encoder.cEncoder
when i upgrade it to VB.net
the
Dim objDecrpt As New Encoder.cEncoder
in VB.Net declaration says
" Type 'Encoder.cEncoder' is not defined" is not defined
how to resolve the problem please help me
|
|
|
|
|
Do you have any idea what you're doing ? Seriously, it seems like you're posting a question for every error you see, without trying anything to resolve them.
VB6 and VB.NET don't have much in common, no conversion is going to work 100%. You need to rewrite a lot of code.
The only hit I see on google is where you asked the same question on code guru. I'd suggest this means that the class is a custom class that has not been moved over to VB.NET.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi Graus
actually I dont have any Idea what am i doing
I am VC++ programr but not VB this is first time am looking VB code
the thing is in our product i am changing the UI look and feel for Vista effect
my total product is in MFC, VC++ that i completed working now one small module ( its called import Utility)is developed in VB so to change the UI of that first i need to upgrade it ti VB.net and changing the UI
for that reason what ever i see as error i am posting in both placess in code guru and code project
since we dont have much time to finish, my first target is forums
sorry if i am behaving like a mad guy but i have to do
ok
u mean to say Encoder.cEncoder is not VB class?
|
|
|
|
|
sarat wrote: I am VC++ programr but not VB this is first time am looking VB code
In that case, welcome to hell Why did you draw the short straw ? Isn't there a VB6 team who has had to maintain this before ?
sarat wrote: u mean to say Encoder.cEncoder is not VB class?
According to google, it's not a built in class, so I assume it's a library your project uses. VB6 and VB.NET are totally different, there's going to be a lot of rewrite, if it's a small project, I'd be inclined to start from scratch
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi all,
I having doubt in 2-dimension. is we can get index of 2-dimension array? or get the index of array by array values?
Help me please.
Senthil
Senthil S
Software Engineer
|
|
|
|
|
A 2D array is really an array of arrays, so myObject(0).GetUpperBound, or whatever, will get you the size of the second dimension.
Senthil S wrote: or get the index of array by array values?
No, you need a hash table for that sort of lookup.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
what is mscomctl?
in the following like of code it complains as "mscomctl" is not delcalred
when i upgrade mt VB6 project to VB.Net ...how can i resolve the issue
here is the code:
<br />
lstToSelect = lstProperties.FindItemWithText(Mid(tvwProperties.SelectedNode.Name, 2, Len(tvwProperties.SelectedNode.Name)), True, 1, mscomctl.ListFindItemHowConstants.lvwWhole)<br />
|
|
|
|
|
MSCommonControls.
The intelligent thing to do here would be to google the command that causes the problem. Like I did:
http://msdn2.microsoft.com/en-us/library/system.windows.forms.listview.finditemwithtext.aspx[^]
Doesn't look like that constant is supported in .NET in any way.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanx for the reply Graus
I am new to VB
ok here the problem is
in VB6 the code is like this :
Set lstToSelect = lstProperties.FindItem(Mid(tvwProperties.SelectedItem.Key, 2, Len(tvwProperties.SelectedItem.Key)), 0, 1, lvwWhole)
and the upgrade vizard changed the code to
<br />
lstToSelect = lstProperties.FindItemWithText(Mid(tvwProperties.SelectedNode.Name, 2, Len(tvwProperties.SelectedNode.Name)), True, 1, mscomctl.ListFindItemHowConstants.lvwWhole)
now it complains " mscomctl " is not declared
how can i resolve the issue
|
|
|
|
|
Thanx Graus
it got solved
with the link u have given me
|
|
|
|
|
Hello,
I wish to develop a on screen keyboard just like the one which comes with Windows XP so that I can transfer data to any application which is selected for example notepad, webpage, word, excel etc. Any help with code samples is highly appreciated.
Cheers!
|
|
|
|
|
Do you want to do it in C#, or VB.NET ? Please don't cross post.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I'm trying to build a program that does the following. I think I can do everything but make the program load a 20 MB Binary file from the C:\ drive, and:
1. Take a pair of bits from the beginning of the file
2. Consider the bits, and do the following:
--If they are 00 or 11, toss both of them from the file.
--If the are 01 or 10, keep the first bit, and toss the second one from the file.
3. Move on to the next 2 bits. Repeat.
It needs to do this to the entire file. I plan to simply type in the file location (Like c:\documents and settings\my user name\my documents\randump\dump1.bin) into a text box. It is named "find". The parse will be started by a button named "parse".
There are just possible problems:
1. There is a big chance that the amount of bits removed won't be divisible by 8. This will create an uneven byte at the end. Does the computer care, or should I be worried?
2. When the binary files are opened in notepad, they look like characters. The program needs to see the bits, not characters.
I'm a VB noob, so can somebody show me how one is to do this?
And if you need any more information about the form setup, please ask.
Thanks in advance
(I'm not in classes. This ain't homework. I learned everything I know from trial and error, and if I tried that with this, I'd be at this computer until the ends of time.)
|
|
|
|
|
Use an io.binaryreader's readbytes method to read bytes into a bitarray, one of whose constructor overloads takes an array of bytes. Don't lose faith in trial and error so quickly; I didn't know how to do that two minutes ago.
Re: problems:
0. Why are you doing this?
1. Yes, the computer cares. For a solution, think carefully about problem 0. You are for reasons unexplained creating a file that no program but your own will be able to read. You could use fill characters or something; without knowing more about what this file represents, I can't help you more than that. If you don't mind multiplying the file's size by eight, you could use binarywriter's write method, with a boolean variable (one byte in size) representing each bit (one = true, etc.).
2. Notepad is reading the bits as bytes using its default encoding scheme (Unicode? UTF-16? I don't know, I don't care). The method described above won't do that.
Good luck,
Steve
|
|
|
|
|
0: If you have ever heard of Random.org, I am working with the webmaster to supply him with raw data. I run a highly similar setup to his, so all I need to do is run a skew correction algorithm devised by John von Neumann. Since Prof. Haahr's software does this as it's coming out of the radio, I can't use it.
1: Prof. Haahr can take this data and shove it right into a buffer. If no skew correction is applied (the goal of this program), then my data is no good.
2. I ran notepad because I use a splitter to break bit dumps (that are over 900 MB in size each) into 19MB chunks, I wanted to make sure there were no added characters. There was not, so all that needs to happen is Skew Correction.
I'm going to try io.binaryreader, if it's built into VB, but in case that is isn't, where is it, and how do I use it?
Thanks!
|
|
|
|
|
who needs to know? wrote: I'm going to try io.binaryreader, if it's built into VB, but in case that is isn't, where is it, and how do I use it?
It is in the System.IO namespace.
|
|
|
|
|
That is pretty damn cool. Given what you're doing, I suggest building the files of arbitrary size out of the original 900MB dump (even if you have to split it up to make the program run faster), by cutting off once the file reaches a length you have specified. That way it'll always get to a size in bits divisible by 8, and you won't have to worry about cramming non-random bits onto the end.
I believe someone answered the io.binaryreader question, but in general, when faced with a problem of this type in VB, type "system." (including the ".") and use the list that comes up to search through the primary namespaces: io, drawing, etc., which will be marked with "{}" to their left. Learn them; their names are descriptive of what they do (except for system.reflection, which is a whole other ball game). For what you're working with (although you seem to have it sorted), my.computer.filesystem is another good place to look in terms of file management.
I'm not sure "take this data and shove it right up his buffer" is the most politic choice of words. Ha ha.
Steve
|
|
|
|
|
I'm still not fully understanding how to:
Make VB open the file at the location specified in the textbox "find"
Make VB load the file's data
Make VB consider the data 2 bits at a time
Make VB change the file
Sorry, but I'm a little slow.
modified on Monday, February 18, 2008 1:36 PM
|
|
|
|
|
What version of Visual basic are you using? Most of this should be fairly easy to figure out using the Intellisense capabilities of VB .NET. Use a filestream object to load the file in the first place; this combines the steps of opening a file and loading its data. In order to examine the data 2 at a time, use the operations listed in another reply (OR, XOR, etc.): I believe they are methods of the bitarray object. You just want to see whether bit 1 is equal to bit 2 or not, so those comparators should be sufficient.
Do not change the file - that would be a complex and unnecessary process. Rather, create a new and empty bitarray and fill in any bits your algorithm deems necessary. From there, you should be able to write it to a file - just look through the bitarray object's methods and something should come up - write to an array of byte; from there it can be written to a file using a binarywriter(?) object.
Steve
|
|
|
|
|
Don't I need to call a... what's it called... "winshell" to make it load somthing from the drive?
|
|
|
|
|
I guess another posible method is to take the data, and load the raw bits as 1's or 0's into a text box, change them, convert them to characters, and save them to a .bin file.
|
|
|
|