|
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?????
|
|
|
|
|
Does anyone know any programs for recording (as in a movie file) actions performed as they look on the screeen. Say i want to write a tutorial on how to use a program, what would i use to record into a movie file the steps i take. Its hard to explain, i hope you guys understand what im looking for.
|
|
|
|
|
You want to do something like the guys over at learnvisualstudio.net? You could try CamStudio... You can get it here:
http://curl.planetmirror.com/pub/winsite/winxp/graphics/CamStudio.exe
There was another program out there I saw before that worked well, but I'd have to search for it. Let me know if camStudio doesn't work for you.
|
|
|
|
|
I found a different one called hypercam and it works but i am going to try the camstudio too, thanks
|
|
|
|
|
Do you have a link to HyperCam? Thanks!
Have a great day!
j2associates_NO_SPAM_@yahoo.com
|
|
|
|
|
|
Thanks for posting the link!
Have a great day!
j2associates_NO_SPAM_@yahoo.com
|
|
|
|
|
You could try Microsoft Movie Maker. It's free with XP. ULead Video Studio I heard is a good one.
But you will also need a video editing board which allows you to connect the media source to your computer. When you buy it video software should come with it also.
|
|
|
|
|
Here is a sample from my connect.vb file. It shows a testing (dev) version of a button and the real version of the button. (These are command buttons in my Excel addin) I want them both to bring up the same form with a different db connection. Is there a way to pass a variable that gets set in these subs to the form?
Private Sub MyUpload_dev_Click(ByVal Ctrl As Microsoft.Office.Core.CommandBarButton, ByRef CancelDefault As Boolean) Handles MyUpload_dev.Click
Dim frm As New frmGOUpload
frm.XLA = excelApp
frm.WS = excelApp.Workbooks(1).ActiveSheet
frm.Show()
End Sub
Private Sub MyUpload_Click(ByVal Ctrl As Microsoft.Office.Core.CommandBarButton, ByRef CancelDefault As Boolean) Handles MyUpload.Click
Dim frm As New frmGOUpload
frm.XLA = excelApp
frm.WS = excelApp.Workbooks(1).ActiveSheet
frm.Show()
End Sub
This is kind of what I am thinking of trying to do in the form:
If <variable> = 'dev' then
Dim wsrv As New SEOWS_dev.Service1
else
Dim wsrv As New SEOWS.Service1
end if
|
|
|
|
|
Make a public Property on your saecond form. Set the property to whatever value you need to pass before the form is shown.
Dim frm As New frmGOUpload
frm.connString = "Whatever..."
frm.XLA = excelApp
frm.WS = excelApp.Workbooks(1).ActiveSheet
frm.Show()
Public Class frmGOUpload
...
Private m_ConnectionString As String
...
Public Property connString() As String
Get
Return m_ConnectionString
End Get
Public Set(ByVal Value As String)
m_ConnectionString = Value
End Set
End Property
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
"Normal" Concatenation of many small strings seems to be very slow in VB6.
Is there a something like a "string builder" or "preallocation"?
Pandoras Gift #44: Hope. The one that keeps you on suffering. aber.. "Wie gesagt, der Scheiss is' Therapie" boost your code || Fold With Us! || sighist | doxygen
|
|
|
|
|
In VB6? I seem to remember that there was a Join function somewhere. ... searching... Ah! Here we go, Join function[^]
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|