|
note on virtual execution system
thank you
|
|
|
|
|
Was that meant to be a question ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
What are you talking about? Are you asking about "virtual machines"?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Sir/Madam,
I am creating the table programically .In the query like
dim sql as string = "create table tablename(field1,text)
After creating the table.I am getting the Memo Field instead of text.all i want is field1 should have text type with some length.But i am getting memo type of field1 in table.
Please help.
Thanks and Regards
Pankaj
|
|
|
|
|
Hi Pankaj,
If I understand you correctly, you are either getting what you want, or you are using the wrong type. In some databases text = memo, in a sense it is type NVARCHAR, but with the maximum length for such a field. If you want to create a field that can contain text of a certain length, you should use:
create table tablename(field1, NVARCHAR(x))
where x is some number.
I hope that answers your question,
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
|
Sir/Madam,
I wanted to know the difference between integer and int32 .Basically in which situations we should use integer and in which situations we should use int32.
Thanks and regards
Pankaj Garg
|
|
|
|
|
Please don't ask twice.
Your question has nothing to do with intptr. There are no situations I can think of where I'd use one over the other, in fact, I use int all the time, I'm not sure they are different ( unless int is not 32 bit, but I assume it is )
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Sir/Madam,
I am sorry .Actually by mistake the title of the problem is written wrong.Next time i will take care of it.
Thanks and Regards
Pankaj
|
|
|
|
|
There is no difference between Integer and Int32. Integer is the VB.Net alias for a System.Int32, a 32-bit signed integer.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
It is best to only use types such as int32, int16 etc. when you need to guarentee a certain number of bits are used to store a value (whether that be numerical, bit flags, or just encoded data of a proprietory type).
If you generally dont care how many bits it takes to store the value use a basic type, such as integer, long etc.
The general purpose, from my point of view, for types such as int32 is to ensure portability of code across several platforms (as I mention above e.g. -- if you are using the bits in a variable to flag information you may need to ensure you have a minimum of 32 bits -- using a basic type like integer does not mean you will necessarily have a 32bit variable, although in the case of .Net this is actually true).
Regards,
Martin
|
|
|
|
|
Sir/Madam,
I want to know the meaning of Intptr.
Dim a as Intptr.
I mean to say that What is the utility of intptr.
Thanks and Regards
Pankaj Garg
|
|
|
|
|
An intptr is a pointer. It's the type used to pass pointers where needed, such as a windows handle.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
'this is the module as followings:
Option Explicit
Declare Function lineGetCountry Lib "tapi32.dll" (ByVal dwCountryID As Long, ByVal dwAPIVersion As Long, ByRef lpLineCountryList As LINECOUNTRYLIST) As Long
Global Const TAPI_VERSION_MIN = &H10003
Global Const TAPI_VERSION_MAX = &H20001
Public Const LINEERR_INVALCOUNTRYCODE = &H80000022
Public Const LINEERR_INCOMPATIBLEAPIVERSION = &H8000000C
Public Const LINEERR_INVALPOINTER = &H80000035
Global grt As LINECOUNTRYLIST
Global GRT1 As LINECOUNTRYENTRY
Type LINECOUNTRYLIST
dwTotalSize As Long
dwNeededSize As Long
dwUsedSize As Long
dwNumCountries As Long
dwCountryListSize As Long
dwCountryListOffset As Long
End Type
Type LINECOUNTRYENTRY
dwCountryID As Long
dwCountryCode As Long
dwNextCountryID As Long
dwCountryNameSize As Long
dwCountryNameOffset As Long
dwSameAreaRuleSize As Long
dwSameAreaRuleOffset As Long
dwLongDistanceRuleSize As Long
dwLongDistanceRuleOffset As Long
dwInternationalRuleSize As Long
dwInternationalRuleOffset As Long
End Type
'this is the code in the form as following
Private Sub Form_Load()
Dim rt As Long
grt.dwTotalSize = Len(grt)
grt.dwCountryListSize = Len(grt)
'GRT1.dwCountryNameSize = Len(grt)
rt = lineGetCountry(1, TAPI_VERSION_MAX, grt)
Select Case rt
Case LINEERR_INVALCOUNTRYCODE
Text1.Text = " LINEERR_ALLOCATED"
Case LINEERR_INCOMPATIBLEAPIVERSION
Text1.Text = "LINEERR_INCOMPATIBLEAPIVERSION"
Case LINEERR_INVALPOINTER
Text1.Text = "LINEERR_INVALPOINTER"
Case Else
Text1.Text = rt
End Select
Text2.Text = grt.dwNumCountries
Text4.Text = GRT1.dwNextCountryID
Text3.Text = grt.dwCountryListOffset
End Sub
thanks
|
|
|
|
|
First, keep this with the original post thread. Don't start a new one.
Second, this is the VB6 code you're trying to convert, not the VB.NET code you've tried. But, change all the Long 's to Integer . Long in VB.NET is a 64-bit signed integer, but under VB6, it was only 32-bits. This is the most common mistake when converting VB6 code.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi all,
New to programing so forgive the basic question.
I have created an app with a form that should fill the screen when loaded (its a big 1 screen app by requirement). I am using a 1280 x 1024 screen and I noticed that when I load it on a friends screen that the form window over fills the screen.
I guess this is something to do with the different aspect ratios or something.
Is there a way that I can make my app window dynamically shrink without lossing any info on the screen- I've tried anchoring the controls and locking them etc but when the parent form is resized they just get cut up.
any help or a point in the right direction would be very much appreciated.
|
|
|
|
|
Add a TableLayoutPanel to your form (Dock style: Fill) and then add your original controls to this. You will need to add rows and columns accordingly to accomodate everything but windows will ensure everything is correctly resized when your form changes at runtime.
Regards
Martin
|
|
|
|
|
Thanks Martin,
Quick question- what is a TableLayoutPanel??
My form consists of a number of controls I have designed myself that are set to a certain size (just are that way because of smallest test box size etc).
When I add these to my form the form size fits perfectly in my window. Now when I load it on my friends PC the window is outside of the screen.
I would like my form to resize everything (i.e. shrink it all) so that it fits in every windows format. Is this possible and is TableLayoutPanel the way to do it (I've looked on MSDN and cannot find a reference for it)
Thanks very much for the reply.
|
|
|
|
|
Hi,
The TableLayoutPanel (I'm using VS2005 Pro, so I've assumed you are using it too, and hoping you have access to this form control!!) is in the "Toolbox" (i.e. where you find labels and textboxes and the like) under the "Containers" section.
It works like a spreadsheet with rows and columns. What you need to do is dock your controls within the TableLayoutPanels cells (its obvious once youve dragged one onto your form)....
Also reading this thread, Are some problems related to the size of the operating system font (i.e. Display Settings->Advanced === By default this will be "Normal". Perhaps your friends PC is set to Large or Extra Large)
Regards,
Martin
|
|
|
|
|
Instead of setting a size, set it to maximise on startup.
Yes, 1024x768 is a different aspect ratio to every other resolution known to man. But, there are also people with widescreen PCs now, so we can't assume *any* aspect ratio anymore.
darkturtle wrote: I've tried anchoring the controls and locking them etc
Anchoring or docking them is really the only option apart from writing your own code to position everything.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Christian,
Thanks for the reply- 1024 x 768 is perfect for engineering work!!! But obviously is causing problems with my program.
When I maximise on start up I still have the same problem- the form controls (my own designed controls) fit into my window but in my friends they get pushed together and overlap making them illegible.
Do you know of anyway to shink them to size??? On my screen they are perfect size but on my friends they look huge!!!
thanks for any help.
|
|
|
|
|
I use anchor for this all the time, it works a treat for me. From time to time, I've written code to manually move things, but rarely.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi
My current project involves upgrading an application from VB6 to VB.Net and make it multilingual. The upgrade part I can handle.
Do you people here have any suggestions/gotchas/pitfalls etc. related to the multilingual part. I am already reading the Globalisation articles on MSDN.
I need some real world issues faced etc.
Any help will be appreciated.
Shreekar
|
|
|
|
|
Hi Shreekar,
One very simple, yet significant problem that I have come across a few times in the past, is the way users change the language in an application. In the beginning I never even considered it, but a user who (really) does not speak the language the application starts up in, will not be able to find the bit of the GUI where to change the language to his/her own. As system admin I was forced to run around a lot, changing the language to whatever was preferred (= a hassle).
Tip 1: symbols and colours are easier to use than words, and will greatly reduce the amount of time coding in different languages.
Tip 2: keep language choices at the top of the GUI.
Tip 3: use a database for the different languages (Name: Button1, Lng1: Button, Lng2: Knop, Lng3: Knöpfe, Lng4: Näppäin, etc.), and rather build in a tool that allows (certain) users to add and/or correct languages, than hard coding each single language. This will also make it much easier to add new functionality and/or controls to your app in the future.
Tip 4: national (culture specific) holidays are a -beep- to consider in coding. I found that it is easier to build in options for users to take them into account themselves. If you must however, I also recommend the use of a database.
For what it is worth.
Johan
|
|
|
|
|
Johan, thanks a lot for the tips. Will keep those in mind. I am thinking of using satellite assemblies for storing the labels and messages text instead of a database. After your thoughts, I will do a rethink.
Another challenge for me is to modify the installation process so that the user can choose the language during install. I am not sure whether the Setup/Deploy architecture in .Net allows for this kind of customisation.
Any suggestions on how I should determine the width of the labels to accomodate differing length strings?
Shreekar
|
|
|
|