|
I want make a resources editor.I could create every component of resources file.But I want it is showed as design mode.What can I do?
|
|
|
|
|
There's a LOT of code involved in something like this. Check out SharpDevelop[^] for an example.
John
"We want to be alone when we hear too many words and we feel alone when it has been a while since anyone has spoken to us." Paul David Tripp -- War of Words
|
|
|
|
|
|
All I want to do is:
I want to make a win32 DLL that takes two LPWSTR's. One [in], one [out]. That's ALL! The problem is, when I call it from C#, the out string is always unchanged. I know this must be simple to do- interop can't suck this bad. Here is my code:
/// In the DLL:
extern "C" {
__declspec(dllexport) void transformIt(LPWSTR,[out] LPWSTR);
void transformIt(LPWSTR markup,[out] LPWSTR changed) {
changed= L"SOME STUFF";
}
}
// The Interop and the call:
[System.Runtime.InteropServices.DllImportAttribute("mydll.dll")]
private static extern void transformIt(
[MarshalAs(UnmanagedType.LPWStr)] string markup,
[Out,MarshalAs(UnmanagedType.LPWStr)] out string changed) ;
string stuff="wefwefw";
string changed; //also tried string changed="",changed=null, and a StringBuilder
transformIt( stuff, out changed);
Console.WriteLine(" >>>>>>>>>>>>>>> " + changed); //empty
I've tried this with a StringBuilder, I've tried with "ref" instead of an "out". No error is thrown, even when I do a try catch block. I know it's finding the DLL ok, becaause I made another test method that just returns an int and it worked. why why why why why why why
Please tell me it's me that sucks and not interop.
"Outside of a dog, a book is Man’s best friend. And inside of a dog, it’s too dark to read."
-Groucho Marx
|
|
|
|
|
Have you tested your DLL in a non .Net environment? Maybe something is just not right with the DLL.
|
|
|
|
|
Well like I say, I tried making a simple function that just returns an int, in the same dll, and calling that from dot net and it worked fine.
Hey can you tell me if I'm assigning the LPWSTR properly? Do I have to do like memory alloc or something, or make a char array? The compiler didn't throw any errors..
thanks
"Outside of a dog, a book is Man’s best friend. And inside of a dog, it’s too dark to read."
-Groucho Marx
|
|
|
|
|
It never gets called!?
If I override a label control then its OnPaint is getting called but not for a textbox, why is it so?
|
|
|
|
|
Some of the .net controls are drawn directly by windows and bypass the .net events. Override the WndProc function and handle thw WM_whatever you need there. Make sure you pass any messages you don't want to the base WndProc function. I had to do this on a toolbar.
|
|
|
|
|
I have various custom controls derived from UserControl that appear in modal forms. Within Dialogs the arrow keys are an alternate form of tab control i.e they move to the next control in the direction of the arrow within the current container ( this is standard windows behaviour I think ).
The trouble is I want to be able to respond to arrow keys in one of these controls. No key event is generated ( or sent to me ). Even overriding WndProc and checking for WM_ messages that way doesn't work.
I notice that list boxes etc are able to get these key events.
Any ideas ?
-Duncan
dmeech AT riverdeep DOT net
|
|
|
|
|
Hi Everyone,
Question: How would I test if someone was holding control while they pressed enter in a textbox?
I'm currently doing this:
int nReturn = Keys::Return;
int nControl = Keys::Control;
int nData = nReturn + nControl;
if (e->KeyData == nData) Now this code works, but you have to press enter twice while you're holding down control. Does anyone know why? Am I doing something wrong in the code? Another quick question, how would I do all code in one if condition? I tried:
if (e->KeyValue == Keys::Return & Keys::Control) but get this warning:
warning C4806: '&' : unsafe operation: no value of type 'bool' promoted to type 'int' can equal the given constant if I put brackets around Keys::Return & Keys::Control it gets rid of the waring, but it still doesn't execute the code in the if block.
I know my code is in MC++, but if you could help (just give your response in C#) it would be very appreciated.
Thanks!
- monrobot13
|
|
|
|
|
Use the BitWise OR operator ('|') not AND ('&')
<a TITLE="See my user info" href=http:
|
|
|
|
|
Now that I think about it that makes a lot more sense. It works now, but I still have to press enter twice for it to actually go into the correct block. Any idea's on that?
Thanks!
- monrobot13
|
|
|
|
|
How do I convert a double value to an byte array (byte[8]) and the reverse from byte array till a double value?
In C++ we may take a memcpy to an char array and cast the array to a float!
|
|
|
|
|
Take a look at Convert class, especially ChangeType method.
43 68 65 65 72 73 2c
4d 69 63 68 61 65 6c
|
|
|
|
|
Look at the BitCOnverter class rather
<a TITLE="See my user info" href=http:
|
|
|
|
|
Hello Gurus,
I've been searching for the common icons such as CLOSE, CANCEL, SAVE, CLEAR, NEW, DELETE, Etc... But no luck. Do you know where I can find them?
Thanks again
Khang Nguyen
|
|
|
|
|
They are not stored as icons, but are stored as bitmaps.
You can create a simple single or multiple document project using the wizard and then copy them from the toolbar resouce.
OR TRY
C:\Program Files\Microsoft Visual Studio\Common\Graphics\Bitmaps
Where there are bitmaps for the items you listed in more than 1 directory.
Trust in the code Luke. Yea right!
|
|
|
|
|
That's very helpful! Thank you very much, John.
Khang
|
|
|
|
|
I am looking for a simple alert box to simply display an error message. I was wondering if there was a C# equivlent to AfxMessageBox Thanks if you have any advice.
Matt Newman
Post best viewed with lynx
|
|
|
|
|
Matt Newman wrote:
C# equivlent to AfxMessageBox
MessageBox.Show (message, title, buttons, icon);
- monrobot13
|
|
|
|
|
Too easy
Matt Newman
Post best viewed with lynx
|
|
|
|
|
|
Kant wrote:
Just remove the Afx.
Too easy, I would have never thought of that
Matt Newman
Post best viewed with lynx
|
|
|
|
|
Hi All,
Question: Is it possible to get the size of the main application? Here's my problem, I have a class that needs to know the size of the main form, but it's buried deep in a class heirarchy so it doesn't have direct access to the forms properties. Is there a function to get the main form?
Thanks!
- monrobot13
|
|
|
|
|
monrobot13 wrote:
it's buried deep in a class heirarchy so it doesn't have direct access to the forms properties
That is nonsense! The root is most buried, all specializations are leafs.
There is the ParentForm property, you can call that continuously.
<a TITLE="See my user info" href=http:
|
|
|
|