|
thanks for your reply, and what should I do about the left one? size it to 0?
as I've asked before how do I get the parent control? have I to pass it as parameter to constructor of the dialogbox? Ho do I get it from main form?
Thanks
Bests
Paolo Ponzano
|
|
|
|
|
can somebody help me to change the window title of a chm file.
i have only the .chm file without any project of type .hhp
dghdfghdfghdfghdgh
|
|
|
|
|
Doubtfull. Have you searched the file with a hex editor ?
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 )
|
|
|
|
|
You can use this[^] to decompile, edit, then recompile chm files.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
Posted this in a few newsgroups but haven't had any luck so thought I'd try here.
I have an interesting problem in one of my applications in which a call to
Form.ShowDialog() is causing a complete system lockup. Ctrl+Alt+Delete has
no effect and after a few seconds the mouse cursor will no longer move. I'd
be grateful if anyone can offer any help with this or suggest anything else to try.
I have reproduced the problem on 3 different machines running Windows XP
Pro.
The Form making the call to ShowDialog() is in a .NET 2.0 assembly and is
being hosted within an old VB6 executable via COM interop. The VB6
application contains a form, which hosts a .NET COM-visible control that in
turn hosts another .NET form (without border, etc). This works fine, but I
have an event set up so that when an icon is double-clicked within a
listview on this form, a dialog box should appear.
The dialog box consists of a few buttons and another embedded form that is
being used as a control. This embedded form is also used on the parent form
where it works correctly.
By setting a breakpoint on the call to ShowDialog(), I can see that no other
threads are executing managed code within the process. If I replace the call
to ShowDialog() with Show() then the window appears correctly. If I make a
call to MessageBox.Show() immediately above the call to ShowDialog(), the
dialog also works correctly. If I host the whole thing in a .NET
application, without the COM interop, everything works as it should.
By reproducing the hang within a virtual machine and using windbg to force
it to crash, then analyzing the crash dump,
I've obtained the following stack trace...
nt!RtlpBreakWithStatusInstruction
nt!KiBugCheckDebugBreak+0x19
nt!KeBugCheck2+0xa51
nt!KeBugCheckEx+0x1b
nt!KdpCauseBugCheck+0x10
nt!KdpSendWaitContinue+0x319
nt!KdpReportExceptionStateChange+0x8a
nt!KdpReport+0x60
nt!KdpTrap+0x108
nt!KiDispatchException+0x129
nt!CommonDispatchException+0x4d
nt!KiTrap03+0xad
nt!RtlpBreakWithStatusInstruction+0x1
nt!KeUpdateSystemTime+0x165
win32k!GetRealOwner+0x12
win32k!ZOrderByOwner2+0x7c
win32k!ZOrderByOwner+0xa9
win32k!xxxEndDeferWindowPosEx+0x86
win32k!xxxSetWindowPos+0x101
win32k!xxxShowWindow+0x250
win32k!NtUserShowWindow+0xa1
nt!KiFastCallEntry+0xf8
ntdll!KiFastSystemCallRet
USER32!NtUserShowWindow+0xc
0x646d0a7
0x6472716
0x647254e
0xa050ff5
0xad542b0
Dfd_Client_UI!Dfd.Client.UI.Workflow.TaskManagement.list_FieldClicked(System.Object,
FieldClickedEventArgs)+0x173
[C:\Work\Ims.Core\Dfd.Client.UI\Workflow\TaskManagement.cs @ 294]
Dfd_Client_CommonControls!Dfd.Client.CommonControls.ObjectList.OnFieldClicked(System.Windows.Forms.ListViewItem,
Dfd.Client.CommonControls.ObjectListColumn,
System.Windows.Forms.MouseEventArgs)+0x7d
[C:\Work\Ims.Core\Dfd.Client.CommonControls\ObjectList.cs @ 1625]
Dfd_Client_CommonControls!Dfd.Client.CommonControls.ObjectList.lv_DoubleClick(System.Object,
System.EventArgs)+0x1ce
[C:\Work\Ims.Core\Dfd.Client.CommonControls\ObjectList.cs @ 1918]
0xad2decc
0xad95d85
USER32!InternalCallWinProc+0x28
USER32!UserCallWinProcCheckWow+0x150
USER32!DispatchMessageWorker+0x306
USER32!DispatchMessageA+0xf
MSVBVM60!ThunderMsgLoop+0x87
MSVBVM60!CMsoCMHandler::FPushMessageLoop+0x19
MSVBVM60!SCM::FPushMessageLoop+0xb9
MSVBVM60!SCM_MsoCompMgr::FPushMessageLoop+0x2b
MSVBVM60!CMsoComponent::PushMsgLoop+0x26
MSVBVM60!ThunRTMain+0x9b
ims!__vbaS+0xa
|
|
|
|
|
Not part of the same debugging session, but I've also got the below info from !analyze -hang -v if it helps. I've no idea what to make of it though, I don't know what resource 0x822e6e08 is, or why the thread is blocking itself.
BLOCKED_THREAD: 82368868
BLOCKING_THREAD: 82368868
LOCK_ADDRESS: 822e6e08 -- (!locks 822e6e08)
Resource @ 0x822e6e08 Exclusively owned
Contention Count = 6148
NumberOfExclusiveWaiters = 10
Threads: 82368868-01<*>
Threads Waiting On Exclusive Access:
820e46a8 822dca30 82284578 82197978
82099260 820bf238 820cc970 820c88b8
82279da8 8205db98
1 total locks, 1 locks currently held
BUGCHECK_STR: LOCK_HELD
LAST_CONTROL_TRANSFER: from 804e3324 to 804e3592
FAULTING_THREAD: 82368868
STACK_TEXT:
f4e65b88 804e3324 00000001 00000000 00000030 nt!RtlpBreakWithStatusInstruction
f4e65b88 bf837de5 00000001 00000000 00000030 nt!KeUpdateSystemTime+0x165
f4e65c10 bf838242 bc669740 f4e65c70 e19d7024 win32k!GetRealOwner+0x15
f4e65c38 bf8380ec bf9aaf60 00000000 bf9aaf60 win32k!ZOrderByOwner2+0x7c
f4e65c84 bf827739 00000000 00000000 bc669740 win32k!ZOrderByOwner+0xa9
f4e65cdc bf82a3da 00000001 00000000 00000000 win32k!xxxEndDeferWindowPosEx+0x86
f4e65cfc bf83910d bc669740 00000000 00000000 win32k!xxxSetWindowPos+0x101
f4e65d30 bf839486 00000000 00000043 f4e65d64 win32k!xxxShowWindow+0x250
f4e65d54 804de7ec 00010304 00000005 0012f994 win32k!NtUserShowWindow+0xa1
f4e65d54 7c90eb94 00010304 00000005 0012f994 nt!KiFastCallEntry+0xf8
0012f970 7e41d8b0 06456819 00010304 00000005 ntdll!KiFastSystemCallRet
0012f994 0646d0a7 0012f9d8 00000005 00000000 USER32!NtUserShowWindow+0xc
0012fa64 06472716 032856d4 00000000 00000001 0x646d0a7
0012faa4 0647254e 0a041383 00000000 030e2ce4 0x6472716
0012fb04 0a040ff5 0336b50c 00000000 032856d4 0x647254e
0012fb34 0ab95236 0336b50c e5dc581d 79e71998 0xa040ff5
0012fc18 0ab0e3fb 0314eb04 0314b804 03234438 0xab95236
0012fc40 0ab0e20d 032856c0 00000000 0324bebc Dfd_Client_UI!Dfd.Client.UI.Workflow.TaskManagement.list_FieldClicked(System.Object, FieldClickedEventArgs)+0x173 [C:\Work\Ims.Core\Dfd.Client.UI\Workflow\TaskManagement.cs @ 294]
0012fc64 0ab0e8a6 032856a4 03219004 0314f718 Dfd_Client_CommonControls!Dfd.Client.CommonControls.ObjectList.OnFieldClicked(System.Windows.Forms.ListViewItem, Dfd.Client.CommonControls.ObjectListColumn, System.Windows.Forms.MouseEventArgs)+0x7d [C:\Work\Ims.Core\Dfd.Client.CommonControls\ObjectList.cs @ 1625]
0012fcc0 0ab0e6c4 030d4fc4 00000007 0314f718 Dfd_Client_CommonControls!Dfd.Client.CommonControls.ObjectList.lv_DoubleClick(System.Object, System.EventArgs)+0x1ce [C:\Work\Ims.Core\Dfd.Client.CommonControls\ObjectList.cs @ 1918]
0012fcd4 0ab65e15 00000000 00050006 0012fcfc 0xab0e6c4
0012fd74 7e418734 00020270 00000202 00000000 0xab65e15
0012fda0 7e418816 02ef7662 00020270 00000202 USER32!InternalCallWinProc+0x28
0012fe08 7e4189cd 00225978 02ef7662 00020270 USER32!UserCallWinProcCheckWow+0x150
0012fe68 7e4196c7 0012fe90 00000001 0012feb8 USER32!DispatchMessageWorker+0x306
0012fe78 73434d53 0012fe90 ffffffff 0153373c USER32!DispatchMessageA+0xf
0012feb8 73434c8c ffffffff 01533764 01530000 MSVBVM60!ThunderMsgLoop+0x87
0012fecc 73434c2e 0153373c ffffffff 01533834 MSVBVM60!CMsoCMHandler::FPushMessageLoop+0x19
0012fefc 73434b6a 01533834 ffffffff 000007f8 MSVBVM60!SCM::FPushMessageLoop+0xb9
0012ff18 73434b35 01533760 01533834 ffffffff MSVBVM60!SCM_MsoCompMgr::FPushMessageLoop+0x2b
0012ff3c 7342ded9 ffffffff 00390039 00320038 MSVBVM60!CMsoComponent::PushMsgLoop+0x26
0012ffb8 0041dede 00422b40 7c816fd7 00390039 MSVBVM60!ThunRTMain+0x9b
0012fff0 00000000 0041ded4 00000000 78746341 ims!__vbaS+0xa
STACK_COMMAND: .thread 0xffffffff82368868 ; kb
|
|
|
|
|
After I finished converting(with visual studio 2005 automatic convertor) a windows application written in vb.net 2002 to vb.net 2005
I recieved few syntax errors that I did not find a sulution for them yet.
The first one is:
The error line - If TypeOf Me.WorkingTable.Column(i).DataType is Boolean Then
The error message- Expression of type 'system.Type' can never be of type 'Boolean'.
|
|
|
|
|
Not sure, but try this:
If Me.WorkingTable.Column(i).DataType is Boolean Then
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
does not work
get this error
boolean is a type and cannot use a an expression.
|
|
|
|
|
Hi, I don't know how to do this in VB.NET; I suggest you ask again in the VB/VB.NET forum.
In C# it would be: if(myVar is boolean) {...}
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
I have webbrowser control and a tool menu. There is a button in the tool menu that when clicked, the webbrowser should surround the selected text with a "<code>" tag. Do you have any idea how can i do this ?
|
|
|
|
|
Hello All,
I am fairly new to VB and I am trying to load a user control (with a few text boxes - nothing special) using the built in snippet:
Dim myAssets As New UserControlAssets()
With myAssets
.Location = New Point(64, 40)
.Size = New Size(668, 488)
.TabIndex = 0
End With
Try
Me.ParentForm.Controls.Item("panelMiddle").Controls.Add(myAssets)
Catch nrx As NullReferenceException
Debug.Print("Apparently its NULL.")
End Try
This is the exception. I have tried variations of different controls, even a listview. I am missing something vital, and I've spent so much time on this. If you cant see the problem from the code but have a clue please respond and I will provide additional data.
Regards,
H. Venn
|
|
|
|
|
You will need to narrow down what part of the following statement is null:
Me.ParentForm.Controls.Item("panelMiddle").Controls.Add(myAssets)
If ParentForm is null, then that's your problem. The other (and more likely) location would be Item("panelMiddle").
Where is this code being executed? If Me is the form that contains the panelMiddle control, then you don't need the ParentForm portion of that code.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
Thankyou, Tom.
The code indeed references the panel incorrectly. I have altered it to
Try<br />
Me.Controls.Item("panelMiddle").Controls.Add(myAssets)<br />
which does work better - it doesn't throw an exception. However, my user control flashes in the viewport for a few milliseconds and is gone. It is also inside the area of the parent form, which seems strange because when I use the code with a stock control it works. I am guessing that because it is a user control I may need some code in its class, however I cannot find any clues. I tried calling myUserControl.Validate() and CreateControl() to no avail. However the information you gave me was crucial. Looking at the code I assumed it was obtaining the reference for panelMiddle from the ParentForm - however the "Me" is like this in C++ so I see why this confuses it.
Cheers,
Henry
|
|
|
|
|
Can you please include more code? It's really hard to tell what is going on from a single line of code.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
Hey Tom
Sorry there's not much to it really - here:
<br />
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click<br />
Dim myAssets As New UserControlIncome()<br />
With myAssets<br />
.Location = New Point(64, 40)<br />
.Size = New Size(100, 20)<br />
.TabIndex = 0<br />
End With<br />
Try<br />
' Original Code causing error: <br />
' Me.ParentForm.Controls.Item("panelMiddle").Controls.Add(myAssets)<br />
<br />
Me.Controls.Item("panelMiddle").Controls.Add(myAssets)<br />
' this doesn't work: Me.Controls.Item("panelMiddle").Show()<br />
Catch nrx As NullReferenceException<br />
Debug.Print(" NULL ref putting user control on panel")<br />
<br />
Catch ex4 As Exception<br />
Debug.Print("Exception - plian vanilla")<br />
End Try<br />
The user control I created using VS8 and even if it is a blank "form" it only flashes on screen for a few seconds. Like I said, if I use a text control, or listview or something, it stays. I've looked at what I can on user controls but all the doc'n I can find deals with the designer - i.e. compile time. (note: the controls work perfectly if I place them on a form, make it invisible and then show it when I need to, but this is a kludge I do not need I feel).
Thanks for your help so far - I am in a position where I am finishing uni and really need to find a team I can work with so I don't get bogged down for so long on these kinds of errors.
Regards,
Henry
ps When I use a textbox or another pre-packaged MS control it is placed correctly on the panel, however when the user control briefly flashes on screen it is out of bounds of the panel, I think at the Point (64,40) of the parent form
|
|
|
|
|
You may need to add the user control to the panel first then update it's Location/Size. If I create a Form in Visual Studio with a Panel that contains a single text box then the designer code loooks like this:
private void InitializeComponent() {
this.panel1 = new System.Windows.Forms.Panel();
this.textBox1 = new System.Windows.Forms.TextBox();
this.panel1.SuspendLayout();
this.SuspendLayout();
this.panel1.Controls.Add(this.textBox1);
this.panel1.Location = new System.Drawing.Point(39, 58);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(200, 100);
this.panel1.TabIndex = 0;
this.textBox1.Location = new System.Drawing.Point(35, 37);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(100, 20);
this.textBox1.TabIndex = 0;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(292, 266);
this.Controls.Add(this.panel1);
this.Name = "Form1";
this.Text = "Form1";
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.ResumeLayout(false);
}
As you can see the TextBox is added to the panel before it's properties are set. Also, make sure to assign a name to your user control. I can't remember off the top of my head, but there are some problems if you don't.
Assuming this doesn't help, if you can put together a small sample project and email it over then I'll be able to figure out the problem a lot quicker.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
Hmmm... thanks again Tom. I built a project to send to you, and it has helped - I think that the user control IS there, however it is hidden beneath a flow layout panel, which I used to structure the entire GUI. Still having the same problem however: the user control sticks to the main window, while a Windows control goes where I ask it, and stays on the panel...
Will experiment a bit more. I can send you the project if a solution doesn't present itself, however I feel that its something to do with addressing the panel - but that does not explain the placement.
Hold the press! I solved it - here's how, and also what surprised me:
It was the sizing, like you said, because the user control would only stay on the screen if I chopped off the "With Events" clause. So I reproduced the problem in a brand new project with a main form, containing 2 panels and 2 buttons, and a user control with a label on it. Embarrassingly, the reason the control was being placed on the panel was some old code in a "Finally" clause - silly me. What surprised me is that a call to clear the panel is only required for a flow layout panel - if not, it will place the next control at the right of any existing user control. Flow layout...maybe I should not be surprised!
Thanks once again - it took awhile but I got there!
Henry
|
|
|
|
|
Er...no I didn't. It worked in the test project, but the real application has a regular panel placed inside a flow layout panel, and it doesn't throw an error....
....10 minutes later....
<br />
panelFlowLeft.Controls.Item("panelRight").Controls.Add(myUC)<br />
That works. The confusion was the flow layout control - the panel could not be referenced as an item of the main form, because it was 3 levels deep. Pretty simple huh? Well - its all learning, and the idea to create a new project is not a new one, but perhaps I can make a rule: if I take more than 20 minutes on an apparently simple problem that should work, isolate, and recreate!
Happy Coding!
|
|
|
|
|
Hi !
How to embedding an Access table into datagrid (C#). After input data in datagrid, then click button save, it's will insert data on datagrid into Access database.
Thanks!
|
|
|
|
|
Just use a datagrid. After data is input, then you need to code the saving code on the save button. Not much else we can help you with since you did not give any real information about database schema, etc.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
I'm busy on a record layout editor for flat file exports. I have a 'preview' window where the user can view a sample of the expected output, the sample being one line for each record type in each grouping. I would like to allow the user to scroll each line left and right, but independently, and would like suggestions on how to achieve this.
I think to keep it simple, I can use a fixed width font and manage a collection of start and end columns for each displayed line, then just render to a textbox the visible portions of each line. Getting more complicated, I could use a lightweight textbox for each line, with an 'invisible horizontal scrollbar', but unless it's as easy as it looks, I think I would be heading down a long, dark path there.
Any other suggestions?
|
|
|
|
|
Hi,
in order to show line oriented text I tend to prefer a ListBox.
If you choose a UserDrawn DrawMode, and implement DrawItem event handler, you could have
each line scroll the way you like.
IMO it is not necessary to select a non-proportional font (although I often do).
Not sure though how you would control the scroll amount...
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Thank you Luc!
You've given me an inspiration that took a few hours to crystallise. I can get the best of both worlds by using a ListBox for my basic line editing, and implement my own character based scrolling. As all my exports are text files, I don't need more than character scrolling for full WSYIWYG.
|
|
|
|
|
You're welcome.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|