|
You can do one of the following:
1. Use Managed Extensions for C++ to make a managed adapter around your unmanaged C++ class and then use it from C# as any other managed type.
2. Make a C wrapper around your unmanaged class (explicit passing of *this , etc) and then use DllImport on the C# side.
I have tried both approaches: the second is usually easier, but it depends on your concrete situation.
|
|
|
|
|
hi all
i have an app built with directx 9.0 and have mesh in it
and i want to get out of using for example Alt+tab to go to another app and the get back to the directx app it tells me there is error called the sample does not exist wt can i do???
|
|
|
|
|
SherKar wrote:
...i want to get out of using for example Alt+tab to go to another app and the get back to the directx app it tells me there is error called the sample does not exist ...
A little clearer please... Are you saying that when you Alt-Tab to another app and then Alt-Tab back to your app, you get an error saying "The sample does not exist."? That isn't an error in any Microsoft documentation so I don't know where it is coming from. If it is a custom error being generated by your code, you'd have to go through your code to find out where it is coming from, because as of right now, there isn't enough information to determine what piece of code is causing the error.
RageInTheMachine9532
|
|
|
|
|
The first thing that comes to mind is that you aren't loading your mesh with the painting procedures. If you're storing this in a buffer, you should also handle the Created event and re-load your mesh in the handler. This event is fired when the buffer is destroyed and re-created, which happens when the app must be repainted.
Other than that, debug your code and catch all exception like Dave was getting at to see where the problem actually happens.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi there,
How can i send a SMS to a mobile through ASP.NET page
Shanaka
|
|
|
|
|
First, ou might want to read up on it here[^]. Not all carriers support the same message transfer protocol, SNPP and WCTP being the most common. And there is even less commonality between carriers and their message formats. The easiest, but least reliable method, of sending a message is to send a standard e-mail to the paging carriers SMTP server. Since SMTP wasn't designed for instant messaging, there can be a considerable time delay before the recipient gets the message.
RageInTheMachine9532
|
|
|
|
|
Hi all,
I have created a simple plugin manager (I got some ideas from: http://www.codeproject.com/csharp/PluginsInCSharp.asp)
So when I compile I get 3 dll's:
PluginManager.dll :: this one contains all the code for loading and storing the plugins
IPlugin.dll :: interface which plugin's must implement in order to work
IPluginHost.dll :: this one contains one interface, and this dll must be made for every project, as there are programm speciffic method in it (see article).
The PluginManager.dll refrences IPlugin and IPluginHost, and the IPlugin refrences IPLuginHost.
And I would liek to make things easier for use, so you would only have to compile IPluginHost.dll if you would liek to expose some methods to plugins.
So how can I make that the PluginManager.dll and IPlugin.dll will refrence the IPluginHost.dll at run-time, knowing that the DLL wil always have the name IPluginHost.dll and that it will be in the same irectory.
If I could do this, then I could just refrence PluginManager.dll and IPlugin.dll in my project copy them in my app dir, make a IPluginHost.dll compile it put-it into my app dir and the other two would use it.
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
First, read How the Runtime Locates Assemblies[^] in the .NET Framework SDK. When developing your application, it makes it much easier if you make project references instead of assembly references for projects in your solution. So, when you right-click on your project that requires the dependencies in your solution, click Add Reference then select the Project tab. Add your project(s). This makes sure that your project is always up-to-date with the latest assemblies (since it sets up dependencies on the build order) and that whenever you switch between build configurations (like Debug and Release, which are created by default) that all the project assemblies are of that build.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanx for the link, I will check it out.
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Hi
Anyone out there know how to do a 'GetPixel' (i.e. find what colour is at a Point) with c#? There's a method GetPixel for a BitMap, but not for an arbitrary point on the screen (or a graphics object). MFC had what I needed, but it's gone from .NET!
|
|
|
|
|
chris fearnley wrote:
(or a graphics object).
You can assign a Bitmap to graphic object with Graphics.FromImage() ,then if you do change in graphic object it is reflected in bitmap. So GetPixel() works there too. I can't undestand how it doesn't solve it.
Mazy
"A bank is a place that will lend you money if you can prove that you don't need it." - Bob Hope
|
|
|
|
|
I don't have an image to use Graphics.FromImage() , I just have some lines that have been mathematically drawn. Can I convert the whole area into a Bitmap,then use GetPixel() ?
|
|
|
|
|
Search this site to find lots of example. You can first create a Bitmap object and assign it to Graphics object, then draw whatever you want to it. This will works I think.
Mazy
"A bank is a place that will lend you money if you can prove that you don't need it." - Bob Hope
|
|
|
|
|
I've just started studying C# and have gotten myself thoroughly confused when it comes to Events. I understand about Delegates and realise the benefits of them, along with how they are constructed/used but Events are causing my head to explode.
I've read through all the tutorials I can find and have looked through the beginners Delegates & Events threads on these boards but still cannot make head nor tail of it.
Can anyone please explain in REALLY simple terms how to create an Event, how to piece the code together and why the code seems to have to be split between different functions and classes, which to me is confusing the issue enormously?
Any help would be appreciated!
|
|
|
|
|
|
hi,
do someone know witch DLL file can contains all nio functions?
like this one: int _kbhit( void ); //Checks the console for keyboard input.
i want to import this function in my c# application.
thank u in advance!
|
|
|
|
|
ok, i've found this in msvcr71.dll
<br />
...<br />
[System.Runtime.InteropServices.DllImport("msvcr71")]<br />
static extern bool _kbhit();<br />
<br />
[System.Runtime.InteropServices.DllImport("msvcr71")]<br />
static extern int _getch();<br />
<br />
public bool KbHit()<br />
{<br />
return _kbhit();<br />
}<br />
<br />
public char GetChar()<br />
{<br />
return (char)_getch();<br />
}<br />
...<br />
|
|
|
|
|
this is a major major problem for me...i could fail my module if i dont implement this in my system!!
i've downloaded some examples from this site but i could not understand whats it doing..and how to implement it in my forms..im hoping some one out there can help me out here...it'll be one reall really appreciated help.
anyways this is my situation, i have frmQueue which has a datagrid showing only one column (ACCT ID) and another form named frmDiagnosis which has got a textbox called txtACCTID. the user clicks on the first cell in the datagrid in frmQueue and it gets loaded in the textbox in frmDiagnosis.
pls some one help me here. im new to C# so the examples really make me feel blur...
CODER
|
|
|
|
|
Declare private varibale in your frmQueue class , type of your frmdiagnosis , and set the TopMost property of it to true. Then when you want to create your form use Show() instead of ShowDialog() ,and then in the CurrentCellChange event of Datagrid set the text of frmQueue varibale, but don't forget to set the textbox modifier to public .
Mazy
"A bank is a place that will lend you money if you can prove that you don't need it." - Bob Hope
|
|
|
|
|
Declare private varibale in your frmQueue class , type of your frmdiagnosis , and set the TopMost property of it to true.
hi mazdak, im not clear about what u said, how do i declare the variable?..
just : "private string celldata"???
and also the forms are already opened.
hope u can help me here
thx in advance
CODER
|
|
|
|
|
ASGill wrote:
how do i declare the variable?..
Yes.
ASGill wrote:
and also the forms are already opened.
Well, you open them somewhere, they haven't open by magic , whenever you open second one use Show() instead of ShowDialog().
Mazy
"A bank is a place that will lend you money if you can prove that you don't need it." - Bob Hope
|
|
|
|
|
Hi Guys,
I'm trying to convert a char[] data recieved from my socket connection into string. please help.
This is what i'm doing
iRx = theSockId.thisSocket.EndReceive (asyn);
char[] chars = new char[iRx + 1];
System.Text.Decoder d = System.Text.Encoding.UTF8.GetDecoder();
int charLen = d.GetChars(theSockId.dataBuffer, 0, iRx, chars, 0);
System.String szData = new System.String(chars);
if I concatinate the szData to a string variable it gives me a space in between words while if I concatinate it to a control.text it was ok .
Is there a way to solve this.
/Dabuskol .. pls..
|
|
|
|
|
Look at the documentation for the String class. It has a constructor that takes a char[] array:
char[] buffer = new char[] {'H', 'e', 'l', 'l', 'o'};
string str = new string(buffer);
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Okay this is what I would like to do. Say there is a game running that has chat capability and sends messages to the server through packets...well i would like to be able to create a small c# app that is capable of inserting text directly into the chat box and then sending it to the server while the game is running. -Basically automating GM tasks and instructions- I know what port is being used if that helps, and im kinda sure that it must go through the client for the char authentication to be used still, so directly sending to server is out. Well thanks for the help.
|
|
|
|
|
If you use DirextX for your game, you can use DirectPlay which is available in .net too for network services like chating, if you don't search for Socket keyword in this site or google to find some example about comunicating for chat services.
Mazy
"A bank is a place that will lend you money if you can prove that you don't need it." - Bob Hope
|
|
|
|