|
I want add some behaviors for DHTML Element.Can somebody give some suggestions.
gxuqin
|
|
|
|
|
|
I am working with some Win32 interop and handling a windows proc. The lParam value, which is typed as long, actually holds a struct. So I define the struct as below, but I am unclear on how to convert the lParam value into a valid variable of type CWPSTRUCT.
I tried using (CWPSTRUCT)lParam.ToPointer() but that didn't compile. I know I'm close I'm just not sure how to cast it properly.
[StructLayout(LayoutKind.Sequential)]
public struct CWPSTRUCT
{
public IntPtr lParam;
public IntPtr wParam;
public uint message;
public IntPtr hWnd;
}
|
|
|
|
|
Ok I think I am halfway there. I have used Marshal.PtrToStructure, but its giving me a runtime error that the structure must not be a "value class". The docs mention that Marshal.PtrToStructure don't support value types, but I'm not sure what that means.
How else can I define my struct to get around this?
|
|
|
|
|
Use Marshal.PtrToStructure(IntPtr, Type) :
CWPSTRUCT cwp = (CWPSTRUCT)Marshal.PtrToStructure(pCWP, typeof(CWPSTRUCT));
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|
I would like to display a set of dates in long format but want to keep all days months and years underneath each other with in a set of text boxes eg
01 January 2003
12 May 2005
14 December 2002
This is similar to how the datepicker works. If I use a space character the years do not line up as all space becomes compressed.
Any Ideas on the character I need to pad out the text with??
Thanks
Steve Graham
|
|
|
|
|
Not sure if this is possible, but try replacing the space character with a tab character, and then set the tab stops for the text boxes. This is the way I would do it with edit boxes or list boxes in MFC or Win32.
Chris Meech
"what makes CP different is the people and sense of community, things people will only discover if they join up and join in." Christian Graus Nov 14, 2002.
"AAAAAAAAAHHHHHH!!!!! Those leaks are driving me crazy! How does one finds a memory leak in a garbage collected environment ??! Daniel Turini Nov. 2, 2002.
|
|
|
|
|
Is there any way to use the IActiveDesktop interface in c#? The only reason I want to do this, is to change the desktop wallpaper, but SystemParametersInfo only works with .bmp files. Is there some other way to do this?
|
|
|
|
|
How can I add an internet explorer type window to an application to display HTML.
|
|
|
|
|
|
emm..I hope this is what you are looking for.
If you are using VS .NET you can add a toolBox refferance to "Microsoft Web Browser" (swdocvw.dll)
The object can now be dragged and dropped onto a form.
And to navigate, assuming object is named axWebBrowser:
We have access to
axWebBrowser.Navigate("s_URL", ref, ref, ref, ref)
axWebBrowser.GoHome();
axWebBrowser.Refresh();
axWebBrowser.GoBack();
axWebBrowser.GoForward();
axWebBrowser.Stop();
etc
gadget
|
|
|
|
|
I am calling SetWindowLong inside my C# Windows Forms app and passing a valid hWnd and the other needed params.
The problem is its returning with error code 127, which the docs describe as:
127 The specified procedure could not be found. ERROR_PROC_NOT_FOUND
Why is this happening? As far as I can tell I've properly declared the function in my project as such:
[DllImport("user32", CharSet=CharSet.Auto)]
public static extern int SetWindowLong (IntPtr hWnd, int nIndex, long dwNewLong);
I don't have the same problem when I call GetWindowLong, only SetWindowLong.
This is pretty frustrating, any suggestions are welcome.
Thanks,
M.
|
|
|
|
|
I think it might be that the hWnd has become invalid, as the window handle has been 'recreated', during initialization, or after a change of certain properties. Is your code currently inside your main class constructor?, if so, try putting it in the form1_Load event.
|
|
|
|
|
That might be it.. I am actually doing this inside a WindowHook, after handling a hooktype of CBT_CREATEWND. I think that may mean that its before a WM_CREATE message has been posted for that window and thus the hWnd is not valid yet. Could that be it?
And that implies I am doing this too soon, and should be handing a different type of windows hook, that of WH_CALLWNDPROC.
Does that sound right?
|
|
|
|
|
DllImport("user32", CharSet=CharSet.Auto)]
public static extern int SetWindowLong (IntPtr hWnd, int nIndex, int dwNewLong);
MyDUMeter: a .NET DUMeter clone "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."
|
|
|
|
|
I don't understand. The docs define it as taking a long as the 3rd parameter and returning a long, not ints in those cases. I must be missing something here?
|
|
|
|
|
MFC LONG is defined as a 32-bit integer, not a 64-bit integer as in the case of .NET long
MyDUMeter: a .NET DUMeter clone "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."
|
|
|
|
|
Hi,
I thought I saw an article on an implementation of an XP sytle App Crash Report util. That allows your app users to send in a report of a crash.
Anyone know if an article exsist like this.. I can't find it.
Thanks@
Amber Star
|
|
|
|
|
amberstar wrote:
Anyone know if an article exsist like this.. I can't find it.
SOrry I dont know of one, but have a look at Application.ThreadException. You can dig around in Reflector.NET as well, he uses such a system. Unfortunately no source. But that is what he uses.
MyDUMeter: a .NET DUMeter clone "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."
|
|
|
|
|
leppie wrote:
he uses such a system. Unfortunately no source. But that is what he uses.
Who is "he"?
Nick Parker
The only man who never makes a mistake is the man who never does anything. - Theodore Roosevelt
|
|
|
|
|
Nick Parker wrote:
Who is "he"?
Lutz Roeder: http://www.aisto.com/roeder/dotnet/[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|
MyDUMeter: a .NET DUMeter clone "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."
|
|
|
|
|
|
David Stone wrote:
I update whenever he comes out with a new version.
In other words every week?
MyDUMeter: a .NET DUMeter clone "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."
|
|
|
|
|
Hi everyone,I'm a newbie of C# and I want to ask the meaning of the line in a sample code.
Here is the code,
namespace HashExample {
// A library contains a list of books.
class Library {
public Hashtable bookList;
public Library() {
bookList = new Hashtable();
}
}
// Books are placed in the library
class Book {
public Book( string t, int n) {
Title = t; ISBN = n;
}
public string Title;
public int ISBN;
}
class ClassMain {
static void Main(string[] args) {
Book b1 = new Book("Programming Microsoft Windows with C#", 0735613702 );
Book b2 = new Book("Inside C#", 0735612889 );
Library myReferences = new Library();
myReferences.bookList.Add(b1.ISBN, b1);
myReferences.bookList.Add(b2.ISBN, b2);
Book b = (Book) myReferences.bookList[0735612889];
Console.WriteLine( b.Title );
Console.WriteLine("\nPress Enter to quit");
Console.ReadLine();
}
}
}
I understood the hash tables.However this line doesn't make any sense on me
Book b = (Book) myReferences.bookList[0735612889];
What is the function of "(Book)" here?What does this mean?
Kind Regards,
-
kromozom
-
|
|
|
|