|
Hi,
I hosted a C# control in an ActiveX control, but now the tabbing between the controls doesn't work anymore.
Any ideas?
Thanks
|
|
|
|
|
This might actually be better to ask in the COM forum, but basically your C# control (via a CCW) must be UIActive - if memory serves me correctly - to receive the focus. This is specific to the container (which would be a native COM container), not the control itself.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I have run into a problem when updating a ListView object with hundreds or thousands of records at a time.
I do a listView1.BeginUpdate before I start and an EndUpdate when I am done, but even though the contents of the listview are not updating, it still takes an inordinate amount of time to update the object (15 seconds for 2000 items).
If the listview is not visible (i.e. the tab the object is on in a tab control is not the selected tab), then it updates in a 10th of the time.
I know there is a LockWindowUpdate available as an API call but either I am calling it wrong or it has no effect on the listview object.
Can anyone out there help me out?
Darryl Borden
Principal IT Analyst
darryl.borden@elpaso.com
|
|
|
|
|
This is happening because, while the control is not visible, the Windows handle is not created. When the Windows handle is not created, no sorting (and a few other things) is done. If the control is visible - even if it isn't currently painting items - it sorts with each addition to the Items collection!
Even using the LockWindowsUpdate API won't do anything to resolve this issue. The BeginUpdate and EndUpdate methods essentially do the same thing. They disable and enable drawing (respectively) by using the WM_SETREDRAW message. While it isn't documented, LockWindowsUpdate probably does this very same thing.
So, you'll either have to bite the bullet and accept the lag, or hide your control and reshow it when you're finished, but that might be annoying to the user. If nothing else, show a progress bar (so add the items in a separate thread, but be sure to use InvokeRequired and Invoke to actually add the items!) while you're adding items to the user knows that something's happening and that they should way. You should also use a try-finally block to show the wait cursor (Cursor.Current = Cursors.WaitCursor ) and, in the finally block, set it back to the default (Cursor.Current = Cursors.Default ).
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hey
I'm looking for at control like the slidemenu in MS Outlook. Is it an existing component ready for use or where do i find information?
Best regards
Rasmus
|
|
|
|
|
Search[^] this site or try google. Being such a popular control, you'll definitely find lots of commercial libraries and probably quite a bit of sample code.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
There are examples here in CodeProjet:
http://www.codeproject.com/cs/miscctrl/csoutlookbar.asp[^]
There is also a great example (I've used it myself) in the UtilityLibrary written by Carlos H. Perez (which I can no longer find in CodeProject.)
-- LuisR
──────────────
Luis Alonso Ramos
Chihuahua, Mexico
www.luisalonsoramos.com
"San Franciso - where men are men - er - women are men - ugh - men are women, and well, the sheep are confused." -- John Simmons, Jun. 25, 2003
|
|
|
|
|
Why will listboxes not change their height correctly? They only resize vertically in certain increments, based on the font size. Is there any way to change this so that you can set the listbox to whatever height you want, and it will actually stay at that exact height?
Thanks,
Blake
|
|
|
|
|
You wanna set the IntegralHeight property to false;
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
Does anyone know how to write directly to the textbox in the ComboBox. I want to bypass the .Text property.
Gary Kirkham
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks
|
|
|
|
|
The only way is to P/Invoke SendMessage and send the WM_SETTEXT (msg is 0x000c = 12) to the ComboBox.Handle (Window handle inherited by the Control class). In actuality, though, this is exacly what the Text property does, but at least doing it this way won't raise the TextChanged event and might not do whatever it is you want to avoid.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Thanks for your reply.
Heath Stewart wrote:
In actuality, though, this is exacly what the Text property does
I am not sure everything the Text property does, but it appears that one thing it does is to step through the list box to determine if the string is already in the listbox. I am developing a control derived from ComboBox and that is the behavior I am trying to bypass.
Gary Kirkham
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks
|
|
|
|
|
Ah, you're right. My memory is a little frag'd right now!
In any case, sending the WM_SETTEXT might work. If not, you could always override the OnPaint event (or, if not available - since most controls in System.Windows.Forms are just wrappers for common controls and some don't allow owner drawing - override WndProc and call OnPaint if the Message.Msg property is 15 (WM_PAINT )).
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I found another way to do it
[DllImport("User32.dll", SetLastError = true)]
static extern bool GetComboBoxInfo(IntPtr hwndCombo, out COMBOBOXINFO pcbi);
[DllImport("User32.dll", SetLastError = true)]
static extern bool SetWindowText(IntPtr hWnd, string lpString);
struct COMBOBOXINFO
{
public int cbSize;
public RECT rcItem;
public RECT rcButton;
public int stateButton;
public IntPtr hwndCombo;
public IntPtr hwndItem;
public IntPtr hwndList;
};
struct RECT
{
public int left;
public int top;
public int right;
public int bottom;
};
.
.
.
.
COMBOBOXINFO comboBoxInfo = new COMBOBOXINFO();
comboBoxInfo.cbSize = Marshal.SizeOf(typeof(COMBOBOXINFO));
GetComboBoxInfo(this.Handle, out comboBoxInfo);
SetWindowText(comboBoxInfo.hwndItem, item.Text);
Gary Kirkham
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks
|
|
|
|
|
Hello,
I am having a problem with the .Net Framework bootstrapper program from Microsoft's website. I'm using it to install my program, and at the end of the installation the bootstrapper program asks the user if they want to reboot the system (this is required because the program will not run correctly without being rebooted). However, when you push Yes, it doesn't reboot.
I've only had this problem with Windows 98. Has anyone else had a problem like this?
|
|
|
|
|
You should check the Microsoft Knowledge Base or post a question to the relevent newsgroup. They did not post any known issues with the bootstrapper (I've seen and tried it before) so there must be a bug that worked its way in and the KB and newsgroups are the best place to get that resolved...not the C# forum!
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I have an assembly in the GAC, but I cannot load it. I get the following error:
An unhandled exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
Additional information: File or assembly name Microsoft.ApplicationBlocks.Logging.EventSinks, or one of its dependencies, was not found.
That is all the information I have. The assembly is in the GAC, so it must be one of its dependencies that is missing, but I cannot figure out which.
Here is the MANIFEST content from ildasm:
.assembly extern Microsoft.EnterpriseInstrumentation
{
.publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A )
.ver 7:0:5000:0
}
.assembly extern mscorlib
{
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 )
.ver 1:0:5000:0
}
.assembly extern System
{
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 )
.ver 1:0:5000:0
}
.assembly extern System.Xml
{
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 )
.ver 1:0:5000:0
}
.assembly extern System.Data
{
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 )
.ver 1:0:5000:0
}
.assembly extern mscorlib as mscorlib_5
{
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 )
.ver 1:0:3300:0
}
.assembly extern Microsoft.ApplicationBlocks.Logging.Schema
{
.publickeytoken = (64 F1 8B 94 EB E8 62 97 )
.ver 1:0:0:0
}
.assembly extern System as System_7
{
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 )
.ver 1:0:3300:0
}
.assembly extern System.Messaging
{
.publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A )
.ver 1:0:5000:0
}
.assembly extern System.Management
{
.publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A )
.ver 1:0:5000:0
}
.assembly Microsoft.ApplicationBlocks.Logging.EventSinks
{
.custom instance void [mscorlib]System.Reflection.AssemblyDelaySignAttribute::.ctor(bool) = ( 01 00 00 00 00 )
.custom instance void [mscorlib]System.Reflection.AssemblyCopyrightAttribute::.ctor(string) = ( 01 00 22 43 6F 70 79 72 69 67 68 74 20 C2 A9 20
4D 69 63 72 6F 73 6F 66 74 20 43 6F 72 70 6F 72
61 74 69 6F 6E 00 00 )
.custom instance void [mscorlib]System.Reflection.AssemblyKeyNameAttribute::.ctor(string) = ( 01 00 00 00 00 )
.custom instance void [mscorlib]System.Reflection.AssemblyKeyFileAttribute::.ctor(string) = ( 01 00 4A 44 3A 5C 50 72 6F 67 72 61 6D 20 46 69
6C 65 73 5C 4D 69 63 72 6F 73 6F 66 74 20 41 70
70 6C 69 63 61 74 69 6F 6E 20 42 6C 6F 63 6B 73
20 66 6F 72 20 2E 4E 65 74 5C 4C 6F 67 67 69 6E
67 5C 6C 6F 67 67 69 6E 67 2E 73 6E 6B 00 00 )
.custom instance void [mscorlib]System.Reflection.AssemblyTrademarkAttribute::.ctor(string) = ( 01 00 00 00 00 )
.custom instance void [mscorlib]System.Reflection.AssemblyConfigurationAttribute::.ctor(string) = ( 01 00 05 44 65 62 75 67 00 00 )
.custom instance void [mscorlib]System.Reflection.AssemblyDescriptionAttribute::.ctor(string) = ( 01 00 24 70 61 74 74 65 72 6E 73 20 26 20 70 72
61 63 74 69 63 65 73 20 4C 6F 67 67 69 6E 67 20
54 6F 6F 6C 6B 69 74 00 00 )
.custom instance void [mscorlib]System.Runtime.InteropServices.ComVisibleAttribute::.ctor(bool) = ( 01 00 00 00 00 )
.custom instance void [mscorlib]System.Reflection.AssemblyCompanyAttribute::.ctor(string) = ( 01 00 15 4D 69 63 72 6F 73 6F 66 74 20 43 6F 72
6F 70 72 61 74 69 6F 6E 00 00 )
.custom instance void [mscorlib]System.Reflection.AssemblyProductAttribute::.ctor(string) = ( 01 00 24 70 61 74 74 65 72 6E 73 20 26 20 70 72
61 63 74 69 63 65 73 20 4C 6F 67 67 69 6E 67 20
54 6F 6F 6C 6B 69 74 00 00 )
.custom instance void [mscorlib]System.Reflection.AssemblyTitleAttribute::.ctor(string) = ( 01 00 24 70 61 74 74 65 72 6E 73 20 26 20 70 72
61 63 74 69 63 65 73 20 4C 6F 67 67 69 6E 67 20
54 6F 6F 6C 6B 69 74 00 00 )
.custom instance void [mscorlib]System.CLSCompliantAttribute::.ctor(bool) = ( 01 00 01 00 00 )
.permissionset reqmin = (3C 00 50 00 65 00 72 00 6D 00 69 00 73 00 73 00
69 00 6F 00 6E 00 53 00 65 00 74 00 20 00 63 00
6C 00 61 00 73 00 73 00 3D 00 22 00 53 00 79 00
73 00 74 00 65 00 6D 00 2E 00 53 00 65 00 63 00
75 00 72 00 69 00 74 00 79 00 2E 00 50 00 65 00
72 00 6D 00 69 00 73 00 73 00 69 00 6F 00 6E 00
53 00 65 00 74 00 22 00 0D 00 0A 00 20 00 20 00
20 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00
20 00 20 00 20 00 20 00 20 00 76 00 65 00 72 00
73 00 69 00 6F 00 6E 00 3D 00 22 00 31 00 22 00
3E 00 0D 00 0A 00 20 00 20 00 20 00 3C 00 49 00
50 00 65 00 72 00 6D 00 69 00 73 00 73 00 69 00
6F 00 6E 00 20 00 63 00 6C 00 61 00 73 00 73 00
3D 00 22 00 53 00 79 00 73 00 74 00 65 00 6D 00
2E 00 53 00 65 00 63 00 75 00 72 00 69 00 74 00
79 00 2E 00 50 00 65 00 72 00 6D 00 69 00 73 00
73 00 69 00 6F 00 6E 00 73 00 2E 00 53 00 65 00
63 00 75 00 72 00 69 00 74 00 79 00 50 00 65 00
72 00 6D 00 69 00 73 00 73 00 69 00 6F 00 6E 00
2C 00 20 00 6D 00 73 00 63 00 6F 00 72 00 6C 00
69 00 62 00 2C 00 20 00 56 00 65 00 72 00 73 00
69 00 6F 00 6E 00 3D 00 31 00 2E 00 30 00 2E 00
35 00 30 00 30 00 30 00 2E 00 30 00 2C 00 20 00
43 00 75 00 6C 00 74 00 75 00 72 00 65 00 3D 00
6E 00 65 00 75 00 74 00 72 00 61 00 6C 00 2C 00
20 00 50 00 75 00 62 00 6C 00 69 00 63 00 4B 00
65 00 79 00 54 00 6F 00 6B 00 65 00 6E 00 3D 00
62 00 37 00 37 00 61 00 35 00 63 00 35 00 36 00
31 00 39 00 33 00 34 00 65 00 30 00 38 00 39 00
22 00 0D 00 0A 00 20 00 20 00 20 00 20 00 20 00
20 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00
20 00 20 00 20 00 76 00 65 00 72 00 73 00 69 00
6F 00 6E 00 3D 00 22 00 31 00 22 00 0D 00 0A 00
20 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00
20 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00
46 00 6C 00 61 00 67 00 73 00 3D 00 22 00 45 00
78 00 65 00 63 00 75 00 74 00 69 00 6F 00 6E 00
22 00 2F 00 3E 00 0D 00 0A 00 3C 00 2F 00 50 00
65 00 72 00 6D 00 69 00 73 00 73 00 69 00 6F 00
6E 00 53 00 65 00 74 00 3E 00 0D 00 0A 00 )
.publickey = (00 24 00 00 04 80 00 00 94 00 00 00 06 02 00 00
00 24 00 00 52 53 41 31 00 04 00 00 01 00 01 00
ED 84 12 34 D6 BD 34 30 A7 EC F3 18 DF 15 E9 5C
F7 89 AF 55 0A 35 20 24 CD 27 DA 48 F3 16 F3 77
2A 82 ED F0 31 E2 8F 21 2B AE 25 1F C1 2A AA ED
D9 4F 04 E9 C9 96 4A AF C0 59 E7 BB 59 86 5E 0B
2D 58 66 6E CC 9D 42 29 DA E3 2C 14 C8 57 72 0E
ED 0C BA 63 8C 2F E6 AD 57 08 F1 8E 26 0A 29 A4
0A 45 36 42 A7 66 A4 D7 7C B8 22 E0 6B B2 1D 50
1E 24 C0 BA 86 15 14 11 BE FC 0B 52 B5 2E 55 A3 )
.hash algorithm 0x00008004
.ver 1:0:0:0
}
.mresource public Microsoft.ApplicationBlocks.Logging.EventSinks.data.xsd
{
}
.mresource public Microsoft.ApplicationBlocks.Logging.EventSinks.EventSinks.resources
{
}
.module Microsoft.ApplicationBlocks.Logging.EventSinks.dll
.imagebase 0x11000000
.subsystem 0x00000003
.file alignment 4096
.corflags 0x00000009
Can anyone tell me where to look?
Tx
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
Look for each assembly referenced at the top of your MANIFEST and make sure that it exists in the GAC and that the version is the same. For the Microsoft assemblies, open each one in ildasm.exe and make sure their dependencies are there. Basically, just make sure that the libraries are installed correctly.
Also, I noticed that your assembly reference both the .NET 1.0 and 1.1 versions of mscorlib.dll. While unusual, it obviously compiled but you must make sure that both .NET 1.0 and 1.1 are installed on the client machine (assuming this is on a different machine than what you compiled on).
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
If you run fuslogvw, you can see what fusion is doing when it's trying to load your assembly. That usually helps me.
|
|
|
|
|
I've figured out how to handle an external > Internal drag drop on a form, the transition of objects to streams is easy enough. The reverse would be the same, but I don't know how to detect external drops, and what path they are being dropped into.
Can anyone help?
Cheers
Cata
|
|
|
|
|
Without system hooks, you can't. You have to pack the data - each with an appropriate clipboard format - and if the target supports that clipboard format, it extracts the data. There are a number of clipboard formats used throughout the Windows shell and that other programs uniformely support (like for text, unicode text, HTML files, etc.). If you use the clipboard formats and pack the data into the IDataObject correctly, the target will take care of the rest.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
So how would I go about determining the target?
I was thinking of doing it by retrieving a file path from the destination, and constructing a file using a stream to that path. But you say that won't work.
How do I set up system hooks?
Cheers
Cata
|
|
|
|
|
The target is responsible for unpacking the data based on clipboard formats it supports. There are no notifications for a drop target event.
As far as Windows hooks go, this would be an extremely difficult - and only hypothetically possible - process. You'd have to watch for particular messages but it would bog down the system incredibly for such a trivial end.
You should read about dragging and dropping in the Shell section of the Platform SDK on MSDN Online. Basically, all you can do is pack data into an IDataObject in .NET. To provide a stream or you have to resort to Win32's IDataObject (different than .NET's) and P/Invoke several methods (the ones that dragging and dropping, and the clipboard functions use internally in the .NET BCL) and create LOTS of structures. Reading about things like STGMEDIUM and FORMATETC should shed some light on this.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Ok, thanks mate.
I will look it all up and figure things out.
Always the best way.
Cata
|
|
|
|
|
Yes it is. Unfortunately, solving your problem with Win32's drag-n-drop is not easy and reading about it is necessary before I could even explain half of the stuff to you (otherwise I end up writing a book! ). So, while you can't be notified of drop operations in another app (unfortunately, this is a problem that many people have asked about), you can use native dragging and dropping to provide a stream when the other application asks for it - just make sure that you use common clipboard formats that the other app supports (like the Windows Shell supports the CF_HDROP while specifying TYMED_ISTREAM to pass a stream reference that the Shell can read, or something like that).
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|