|
Jimmanuel is right on the money....
You need to use the appropriate types to interop.
DWORDs will never be a C# long - they are always unsigned 32-bit ints.
A BOOL is an int, which is a 32-bit signed int.
As Jimmanuel mentioned, you also can't use a string as an out parameter like that.
Put that all together and something like this should work:
[System.Runtime.InteropServices.DllImport("winmm.dll")]
private static extern int mciGetErrorString(UInt32 errorCode, StringBuilder buffer, UInt32 iReturnLength);
I tested this with the following code and it worked:
StringBuilder sb = new StringBuilder(260);
mciGetErrorString(256+37, sb, 260);
Console.WriteLine(sb.ToString());
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi
i want to trace my application to get information how much memory allocate to each objects and ...
does visual studio has this tool ? (i don't implement this by code, i want to trace my app visually)
how to do ?
thanks
|
|
|
|
|
I want to display doc file in my C# Application
how can I do it?
Do you have any viewer about it
Thanks in advance
Hello Friends
|
|
|
|
|
You can do this through VSTO or other third party software.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
You can use the Office Interop Library, but that is going to require your users to have Office installed.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Microsoft Office Word Viewer 2003 lets you view and print Word documents on a computer that does not have Word installed. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
889347 (http://support.microsoft.com/kb/889347/) Description of the Microsoft Office Word Viewer 2003
Vikas Amin
UNITED STATES STEEL CORPORATION
My First Article on CP" Virtual Serial Port "[^]
modified on Thursday, July 24, 2008 5:33 PM
|
|
|
|
|
many but not all doc files open without any issue with WORDPAD
Vikas Amin
UNITED STATES STEEL CORPORATION
My First Article on CP" Virtual Serial Port "[^]
modified on Thursday, July 24, 2008 5:33 PM
|
|
|
|
|
|
|
ahaa, I found the problem. If the html source has a big VIEWSTATE, it doesn't respond.
when I put spaces somewhere in the big viewstate regex was responded.
Now I'm removing all viewstates's values
It's working perfect
I want to fly but I don't have wings
modified on Wednesday, August 6, 2008 12:55 PM
|
|
|
|
|
I see. I believe that it's the "\S+-image" part that is making it slow.
The \S+ will match the entire viewstate value, but then it will not find "-image" at the end of it, so it will start going back through the viewstate character by character looking for "-image".
Use som reasonable limit like \S{1,20} and it should be much faster.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hey,
How would one load a form in the background? I have a couple of complex forms that take some time to load on .net compact framework.
|
|
|
|
|
If the compact framework has it, you could use a backgroundworker and return the form(s) in the result property.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
|
|
|
|
|
If the compact framework has it, you could use a backgroundworker and return the form(s) in the result property.
If it hasn't, you can do the same without the backgroundworker by using the Thread class (which the compact framework definitely has).
But you won't have much fun with a form created that way. It's handle will have been created by a thread that has terminated when you get the form, so you can hardly do anything with it.
|
|
|
|
|
Hi,
I need to automate a web application. For this I am using C#.net and a Libary called "WatIn" whose reference I got from article on this site.
Using this it is simple to automate the general web applications. But My problem is different.
The Web Page is of course not developed by me but its source code(javascript) I have access to them.The application containes Combobuttons. I am able to access those buttons but the only problem is that when I click on any of the combo button it launches a web-dialog. But what I need to do is to expand the ComboButton and make a choice from them so that appropriate dialog box gets launched.
Also the combo buttons are arranged just as "Help", "Links", etc links are on this site, the only difference being that I can identify all the menu items under Help using Internet Explorer Deloper toolbar..
Can anybody out there help me in accessing those elements which are not identified by the Internet Explorer Developer toolbar.
Please Help. Thanks in advance.
Purusottam Mishra
Systems Executive
|
|
|
|
|
Hi all,
I want a customized treeview where i want checkbox in a haphazard manner for eg. sometime i want to add checkbox in both parent and child node, and sometimes only in child node. for that i am trying to override the TreeNode class,so that i can add that class object(node) when i need a node with checkbox else the default TreeNode object(for this node.DrawDefault = false) but not getting any clue. Can somebody plz help me out.
Thanks in advance
sanjeev
|
|
|
|
|
I'm sure you can already do that with the current TreeView.
|
|
|
|
|
please give me some clue so that i can proceed
|
|
|
|
|
Well the TreeView has the Property ShowCheckBoxes /none/Leaf/Parent/Node/All
Would this work fine.
|
|
|
|
|
hi,
I am working on site Builder Application,I used HtmlEventProxy Class
to attache Event ,but when i run exe i get this error (unable to cast object of type 'System.Windows.Forms.Button' to type 'HtmlEventsSmple.HtmlEventproxy'), i dont know how to solve this problem , please help me .
thanks
Wafy
|
|
|
|
|
HI,
How to read a html file with images using c# and send mail with the contents of html including images in the body of the mail?
Thanks in advance
|
|
|
|
|
1) open the html file by either issuing a HttpWebRequest[^] to a URL or open it locally from the hard drive
2) parse the html code for references to the images. This can be either the html <img> tag or they can be embedded via CSS, which is harder to parse
3) Create a MailMessage[^], add the images to the Attachments collection and set it via the SmtpClient[^].Send method
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Can you please provide sample code because im new to c#. Please help
|
|
|
|
|
It's too much code to write at once. Try writing code for each of the points separately. Each MSDN page I linked has some examples how to read from websites, send mails etc.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
No One Can Hellp Me About Serialisation For Windows Application
No One Can Hellp Me About Serialisation For Windows Application
Thaer
|
|
|
|