|
scan registry under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office
If it doesn't exist, then no word installed, otherwise scan all subfolders whose names are all past and current installed office versions.
|
|
|
|
|
I am trying to initialize sockets in my code with the following:
Private Declare Function WSAStartup Lib "WSOCK32.DLL" (ByVal wVersionRequired As Long, ByVal lpWSADATA As WSADATA) As Long
Public Const WS_VERSION_REQD As Long = &H101S
Public Function SocketsInitialize() As Boolean
Dim WSAD As WSADATA
SocketsInitialize = WSAStartup(WS_VERSION_REQD, WSAD) = ICMP_SUCCESS
If SocketsInitialize = False Then
MsgBox(Err.LastDllError)
End If
SocketsInitialize = True
End Function
The WSAStartup fails with the err.lastdllerror code returned is 126. Does anyone have any idea what I am doing wrong? This worked in VB6 but I am now running VB.net.
|
|
|
|
|
Easy.
First, don't use the API's. Use the System.Net.Sockets namespace to do the same thing. This will more than likely require you to rewrite your code.
Second, Longs in VB6 are Integers in VB.NET. Because you didn't change the data types, your now trying to pass 64-bit integers, instead of 32-bit, to the function.
System.Net.Sockets namespace[^]
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
could i use something like:
Protected Override Close() handles Mybase.close()
to create a custom close function (like saving data before it exits) or if not, how would i do it?
|
|
|
|
|
Sure, just be sure to call the MyBase.Close when you're done.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I would like to have the caret displayed while I am editing a MSHFlexGrid. I have tried the API call ShowCaret(MSHFlexGrid1.hWnd) with no visible affects. Any ideas?
Thanks,
Tim
|
|
|
|
|
I could be wrong, but after researching the problem, I don't think it's supported.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Using Visual Basic 6.0, I need to sort a ListView by Number. I only find the following sort settings:
lvRows.Sorted = True
lvRows.SortOrder = lvwAscending
lvRows.SortKey = 3
When the column SortKey is of type Integer, it will still sort it as if it is text:
1
10
11
12
2
3
4
5
6
7
8
9
I did some searching, and it looks like someone using C# got a handle on it - I just need it for Visual Basic 6.0:
http://www.codeproject.com/cs/miscctrl/ListViewColumnSorter.asp[^]
It would also be nice to know how to sort by multiple columns like we do with an SQL statement (ORDER BY column1, column2), and recognize numbers from text.
Thanks ahead!
Bryan Borough
Orem, UT
|
|
|
|
|
This is because your actually sorting Strings, not numbers. The control treats everything as a string during a sort. So, what you have to do is create a new, hidden (width 0), column with equivelent numbers in it left padded with 0's. Like this:
1 000001
2 000002
3 000003
An example of which can be found here[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks a million, Dave. Is there anyway to give you good feedback on here besides saying "Thanks"?
Bryan Borough
Orem, UT
|
|
|
|
|
Yeah! The little "Rate this message" things in the bottom right of every message window.
Thanks! Glad to help!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
The trick is to do your own sort into a collection and then populate listview directly from collection. for integer sort, you will need to find the largest number to determine the maxlength and then pre-pad 0s up to the maxlength on every number before performing the sort. Multiple column sorting is also going to be a bit tricky, but its possible. You should consider making this into a class so that it can be used in any future projects where you may need it. A good sort algorithm is something like:
Dim colLvw As New Collection, n, i As Integer
Dim lvwItm As ListViewItem
For n = 2 To colLvw.Count
i = n
While (i > 1)
If (StrComp(colLvw(i).[whatever listview column's value], colLvw(i - 1).[whatever listview column's value]) < 0) Then ' use > for descending order
colLvw = swap(colLvw, i, i-1)
i = i - 1
Else
i = 0
End If
Wend
Next
' now collection is sorted so populate listview
Call PopulateListView(colLvw)
Private Function swap(colLvw As Collection, nNdx1 As Integer, nNdx2 As Integer) As Collection
Dim tmpLvw As ListViewItem
tmpLvw = colLvw(nNdx1)
colLvw(nNdx1) = colLvw(nNdx2)
colLvw(nNdx2) = tmpLvw
swap = colLvw
End Function
|
|
|
|
|
Hi,
I have built a activex user control for stock ticker which fetches an xml data file from a valid url. It works in a windows application in a perfect manner. I can create exe too.
I am now trying to embed the control in a html page but cant do that. It works very fine in that the background color and everything gets changed in that. But as soon as I load the html page i get the following error :-
Request for the permission of type System.Net.WebPErmission, System, Version=1.05000.00, Culture=neutral, PublicKeyToken=b77a5c561934e089failed.
If i continue no data is fetched from the url and displayed by the control. And the details section consists of follwing :-
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.Security.SecurityException: Request for the permission of type System.Net.WebPermission, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.
at System.Security.CodeAccessSecurityEngine.CheckHelper(PermissionSet grantedSet, PermissionSet deniedSet, CodeAccessPermission demand, PermissionToken permToken)
at System.Security.CodeAccessSecurityEngine.Check(PermissionToken permToken, CodeAccessPermission demand, StackCrawlMark& stackMark, Int32 checkFrames, Int32 unrestrictedOverride)
at System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission cap, StackCrawlMark& stackMark)
at System.Security.CodeAccessPermission.Demand()
at System.Net.HttpRequestCreator.Create(Uri Uri)
at System.Net.WebRequest.Create(Uri requestUri, Boolean useUriBase)
at System.Net.WebRequest.Create(Uri requestUri)
at System.Xml.XmlDownloadManager.GetNonFileStream(Uri uri, ICredentials credentials)
at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials)
at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn)
at System.Xml.XmlTextReader.CreateScanner()
at System.Xml.XmlTextReader.Init()
at System.Xml.XmlTextReader.Read()
at Axticker.ucTicker.loaddbase()
at Axticker.ucTicker.ucTicker_Load(Object sender, EventArgs e)
at System.Windows.Forms.UserControl.OnLoad(EventArgs e)
at System.Windows.Forms.UserControl.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.UserControl.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ActiveXImpl.System.Windows.Forms.IWindowTarget.OnMessage(Message& m)
at System.Windows.Forms.ActiveXImpl.System.Windows.Forms.IWindowTarget.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/windows/microsoft.net/framework/v1.1.4322/mscorlib.dll
----------------------------------------
System.Drawing
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/windows/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll
----------------------------------------
System
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/windows/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
----------------------------------------
RegexAssembly10_0
Assembly Version: 0.0.0.0
Win32 Version: n/a
CodeBase:
----------------------------------------
Axticker
Assembly Version: 1.0.2007.291
Win32 Version: n/a
CodeBase: http://comp2/stock/Axticker.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/windows/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll
----------------------------------------
Microsoft.mshtml
Assembly Version: 7.0.3300.0
Win32 Version: 7.0.3300.0
CodeBase: file:///c:/windows/assembly/gac/microsoft.mshtml/7.0.3300.0__b03f5f7f11d50a3a/microsoft.mshtml.dll
----------------------------------------
Accessibility
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/windows/assembly/gac/accessibility/1.0.5000.0__b03f5f7f11d50a3a/accessibility.dll
----------------------------------------
System.Xml
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/windows/assembly/gac/system.xml/1.0.5000.0__b77a5c561934e089/system.xml.dll
----------------------------------------
Microsoft.VisualBasic
Assembly Version: 7.0.5000.0
Win32 Version: 7.10.3052.4
CodeBase: file:///c:/windows/assembly/gac/microsoft.visualbasic/7.0.5000.0__b03f5f7f11d50a3a/microsoft.visualbasic.dll
----------------------------------------
************** JIT Debugging **************
To enable just in time (JIT) debugging, the config file for this
application or machine (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitdebugging="true">
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the machine
rather than being handled by this dialog.
Could anybody suggest me how to resolve this error. It prohibits my page from getting the data from external url and in the end no data is displayed.
Regards
Rohan Kaul
|
|
|
|
|
I would imagine that it is a Code Access Security problem. You might want to ask this in the ASP.NET Forum for a solution.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Been trying to work through this one for a while now....
I have an MDI application with a side nav bar (docked form with buttons) that creates MDI children... On a couple of the MDI children I need to check my access database to see if there is existing data ( for instance, the user clicks edit, the app needs to check if there is anything to edit). If there is no existing data, I have a dialog box (YES,NO) generated asking if they would like to add data now.
If yes, no problem, everything works. If no, I want the form to just close. DIE!
But instead I get "cannot call close() while doing createhandle().".
I figured I would remove the logic from the form load and that would be that.
So I left an IF statement in form_load that call my function....nope..
I need to make the check at the beginning...what am I doing wrong?
Is there someway to abort the createhandle()? Form.HandleCreated doesn't seem to work... sorry for the long post..
|
|
|
|
|
oakleaf wrote:
On a couple of the MDI children I need to check my access database to see if there is existing data
This isn't proper design. You should be checking this BEFORE your MDI child form is created. Not checking for it in the child form. This is why your running into this problem. You can't close the window in the form's Load event because the form's window hasn't been created yet! It's created AFTER the Form Load event executes.
You'll have to change your code so your checking the database before you launch your child form. This way, you at least have the opportunity to decide which form to launch based on the users input.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave Kreskowiak wrote:
You should be checking this BEFORE your MDI child form is created. Not checking for it in the child form.
Thanks for the reality check. You are right. I needed that.
I was hoping to keep all the code for each form within the individual child, and find an event that would allow me to confirm that the window was created, so I could close it. But why make life difficult.
Thanks again.
|
|
|
|
|
The forms in your application should each be responsible for one thing and one thing only. In your case, you have the data entry form responsible for two things. The first is checking to see if it is needed, and the second, obviously is the data entry. Always(!) keep this functionality seperate.
If it's a data entry form, it strictly handles data entry. If it's a form that displays records and lets a user pick one to edit, it handles strictly that. Create another form that handles editing the record picked.
I've seen a couple people that wanted to hide the datagrid and put up a run-time generated list of controls on the same form. WHY? Why must these people do it the hard way???? Always favor functionality over looks. If your app looks great, but works like crap, its headed for the Add/Remove Programs control panel.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi all.
My environment is Win XP, VB.NET.
I have a simple picture box that is FIXED size and I want it to show a picture at a run time. But every time I insert a picture in it it shows me just a small portion of the entire picture.
How do I make my picture box display the entire picture without resizing itself....
|
|
|
|
|
By changing the properties of the picture box so that it scales the image to fit the picture box.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I need to write an app that plays only AVI files, nothing else. Anyone know the best way to start, or any good resources?
|
|
|
|
|
Here's one using DirectShow
http://www.codeproject.com/useritems/direct_show_-_playa.asp
and here's another one
http://www.vbcodesource.com/exampleNet.html
(4th one down)
|
|
|
|
|
i am looking at the vbcodesource.com example because i dont do ++
Why am i getting squiggly lines under this
Imports Microsoft.DirectX.AudioVideoPlayback
That is exactly how it is in the project. Any ideas???
|
|
|
|
|
You probably don't have the Managed DirectX SDK installed. Get it here[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
when i get the DirectX SDK where do i put the extracted files?????
|
|
|
|
|