|
Edit AssemblyInfo.cs. You will see a line that says something like
[assembly: AssemblyVersion("1.0.0.0")] Change it to whatever version you want.
Cheers,
Vıkram.
After all is said and done, much is said and little is done.
|
|
|
|
|
I'm writing a wrapper for a win32 frame grabber library. When an image is aquired by the grabber my win32 wrapper DLL needs to pass the image data (stored in large WORD arrays) to the C# front end. I'm calling into the managed code from the win32 DLL via a callback delegate when an image is acquired and ideally I would like to pass the image data in this function call as well but i'm unsure as to the best way to accomplish this? I've looked around and found plenty of information about passing arrays and pointers to unmanaged code but not the other way. If possible I would like to minimise any overheads caused by copying the large amounts of data. Any suggestions would be appreciated.
Thanks.
|
|
|
|
|
C# can only work with unmanaged memory through pointers or methods like Marshal.ReadByte(). If you want to have the buffer directly be treated as an array, it must be originally allocated by managed code. One way to do this is to create an array, pin it, get an address to it, and then use that as the data buffer:
short[] buffer=new short[dataLength];
GCHandle handle = GCHandle.Alloc(buffer, GCHandleType.Pinned);
IntPtr bufferPtr = Marshal.UnsafeAddrOfPinnedArrayElement(buffer, 0);
--Justin
Microsoft MVP, C#
|
|
|
|
|
Hi,
I agree: if the native API allows it, allocating a managed array, and passing it
to the unmanaged world is the best way (BTW dont forget to free the GCHandle).
If the API does not support this, and the native function takes care of its own
allocation, then all the data will have to be copied in order to create a managed image;
and of course you then somehow must free the unmanaged memory.
|
|
|
|
|
Hello everyone, im using VS2005, i have a webpage in which i have a FileUpload control, and a Submit button. On the Submit button (.cs)page, i call this line :
FileStream FilStr = new FileStream(FileUpload1.FileName, FileMode.Open);
but at run time whenever i select a file and then click on submit button, it gives me the following exception at the above line of code:
System.IO.FileNotFoundException: Could not find file 'C:\WINDOWS\system32\VS_logo.PNG'. File name: 'C:\WINDOWS\system32\VS_logo.PNG' at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode) at Reports_DynamicImage.btnSubmit_Click(Object sender, EventArgs e) in d:\Projects\RubberDuck\Code\CrystalReportsSolution\CrystalReportsWeb\Reports\DynamicImage.aspx.cs:line 42
plz tell me whats wrong with this, and y its looking the image in the C:|windows as the image is in the Mypictures foders of the My Documents. I includede the using System.IO namespace also but this exception still comes. help me its urgent
reply me asap.
Thanx in Advance.
rida
|
|
|
|
|
It said
Could not find file 'C:\WINDOWS\system32\VS_logo.PNG'
I think your visual studio or system was demaged ,
|
|
|
|
|
I have VS2005 and that image doesn't exist on my system either. How are you getting the path to the image, allowing the user to browse? Perhaps try and hardcode the path and let me know what happens.
There are 10 types of people in the world, those who understand binary and those who dont.
|
|
|
|
|
yes u right, i have a Fileupload control, in this a text box and Browse filed exists, user clicks on the browse button and the path is set into the text box, so that y me using that line of code ::
//string fname = FileUpload1.FileName;
//Response.Write(fname);
//get the image file into a stream reader.
FileStream FilStr = new FileStream(FileUpload1.FileName, FileMode.Open);
BinaryReader BinRed = new BinaryReader(FilStr);
as u see the comments stmt codes when i used this one, or hardcode the path in the FileStream line , it gives me the same error,
plz help me how can i get rid from this.
Thanx in Advance.
|
|
|
|
|
ASP.NET's working directory is C:\WINDOWS\system32\, and besides, you cant use the client path on the server, thats just absurd!
|
|
|
|
|
Hi Leppi ur link not working at my side, this page is not opened.
|
|
|
|
|
Hello everyone,
I have a Window Application which is currently using TabControl to have number of pages with different functionalities and controllers. I was wondering if I can replace the TabControl with something rather like Microsift OutLook "Using Buttons to change the page". I just wish the pages not to have any tab so the page appears to be the only the form.
Thank you very much and have a great day.
Khoramdin
|
|
|
|
|
Hello,
I guess you have to build the UserControl yourselve or look for some comercial controls!
All the best,
Martin
|
|
|
|
|
Hello Martin,
Thanx for the reply, mate. Would you by any chance know of any comercial controls that would be able to produce that?
I have looked into Professional UI Solution and Dev Components and it appears they don't have this kind of control.
Thank you very much for your help.
Khoramdin
|
|
|
|
|
|
Hi Khoramdin,
Have you tried looking at the "Expando" (google it). Its the menu that sits on the left side of the window when you open 'My Computer', thats if you are using Win XP.
Mvelo Walaza
Developer
Telkom SA
|
|
|
|
|
Never mind... I'm just too stupid .
I found the mistake...
|
|
|
|
|
Hello
I am developing an application in C#, in which i am searching the network computers. But it is taking so much time. So tell me how can i make this application fast in terms of speed.
Thanks
Devesh Mishra
|
|
|
|
|
As opposed to fast in terms of.... ?
If it searches the same machines over and over, you can build an index on those machines and search that instead. If the machines change, you can buy faster network cards.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thanks for your reply.
I am searching the network computers from the network directory. Its not searching the same machine over and over. Now tell me that how can i improve the speed or is there any other way to search the network computers.
Thanks
Devesh Mishra
|
|
|
|
|
You could rely on the information Windows itself is holding; see several CP articles,
e.g.
http://www.codeproject.com/useritems/ExplorerTree.asp[^]
If you want to discover network computers yourself (say with ping), you must avoid
doing it completely sequentially; so you may want to use a couple of threads (I
suggest no more than 4), as has been the topic of many forum items before.
|
|
|
|
|
aHi,
i think you need to start several threads at once!
|
|
|
|
|
Hi
Thanks for ur reply..
But plz tell me that how can i start multiple thread at once...
Thanks
Devesh Mishra
|
|
|
|
|
there are many kinds of threads:
the basic one is :
<br />
private void MethodA()<br />
{<br />
System.Threading.Thread t1 = new Thread(new ThreadStart(MethodB))<br />
System.Threading.Thread t2 = new Thread(new ThreadStart(MethodC))<br />
<br />
}<br />
<br />
private void MethodB()<br />
{<br />
}<br />
private void MethodC()<br />
{<br />
}<br />
if the methods that you want to call have input, so you need to use a parametrized thread :
<br />
using System;<br />
using System.Threading;<br />
<br />
public class Work<br />
{<br />
public static void Main()<br />
{<br />
Thread newThread = new Thread(<br />
new ParameterizedThreadStart(Work.DoWork));<br />
<br />
newThread.Start(42);<br />
<br />
Work w = new Work();<br />
newThread = new Thread(<br />
new ParameterizedThreadStart(w.DoMoreWork));<br />
<br />
newThread.Start("The answer.");<br />
}<br />
<br />
public static void DoWork(object data)<br />
{<br />
Console.WriteLine("Static thread procedure. Data='{0}'",<br />
data);<br />
}<br />
<br />
public void DoMoreWork(object data)<br />
{<br />
Console.WriteLine("Instance thread procedure. Data='{0}'",<br />
data);<br />
}<br />
}<br />
<br />
<br />
<br />
For more examples, search in the MSDN Library
|
|
|
|
|
Asalam-o-Alaikum:
I have created a mailmerge document using c#,it works fine when i run it on a seperate project but when i try to run it on VSS(Visual Source Safe)it gives me this error:
"Creating an instance of the COM component with CLSID {00020906-0000-0000-C000-000000000046} from the IClassFactory failed due to the following error: 8001010a."
after compiling this line
"Word.Document oWordDoc = new Word.Document();"
can anybody know whats going on.
thanx
|
|
|
|
|
i want to show ballon tooltip on the cells of datagrid
|
|
|
|