User Profile

Collapse

Profile Sidebar

Collapse
l034n
l034n
Last Activity: Aug 4 '09, 05:40 AM
Joined: Oct 2 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • l034n
    replied to File reading
    in C
    Yes, it can be a const char* if you don't want to modify it. So, the line:

    Code:
    unsigned char* buffer = ReadFile(filename, len);
    would be:

    Code:
    const unsigned char* buffer = ReadFile(filename, len);
    And also change the return value of ReadFile(). I wrote it as unsigned char* again because it was how i did it in the first example. But if you want to use char* instead of unsigned...
    See more | Go to post

    Leave a comment:


  • l034n
    replied to File reading
    in C
    Well, it does indeed have errors. Check out this one.

    Code:
    unsigned char* ReadFile(const char* szFileName, long& length);
    
    int main(int argc, char* argv[])
    {
    	long len = 0;
    	const char* filename = "c:\\test.txt";
    	unsigned char* buffer = ReadFile(filename, len);
    
    	if(buffer)
    	{
    		// Do something with the buffer
    		//.....
    
    		// And clean up after
    ...
    See more | Go to post

    Leave a comment:


  • l034n
    started a topic Get proper HTML response
    in .NET

    Get proper HTML response

    I am writing a small C# application that is supposed to download the files from a given URL. When i parse the HTML, i check the headers to see if the response is "text/html" and if so, to skip the file, since i suppose it's not a file (well, it is, but i just don't need text files or htm/html etc).
    However, recently i was trying to download pdf files from: http://pdonline.brisbane.qld.gov.au/...icationmaster/...
    See more | Go to post

  • You'll need to kill excel, as it's not quitting, even if you call Quit().

    Code:
    private void KillExcel()
    {
    	Process[] excelProcesses = System.Diagnostics.Process.GetProcessesByName("Excel");
    
    	foreach(Process p in excelProcesses)
    	{
    		p.Kill();
    	}
    }
    Well, that will effectively kill all Excel processes, so if you have opened 10 excel instances...
    See more | Go to post

    Leave a comment:


  • l034n
    replied to How to pass by reference in C++ .net?
    in C
    Ok, i see some things have been confused here and it has to do with the way the variables are declared... The example of vinayvaka will work as will many of the above examples (even though they didn't work for BahatiSiD). So, why?
    Or... although the example of vinayvaka works as it is, if BahatiSiD tries it with his variables, it won't, i guarantee you that.
    Well, BahatiSiD have declared his variables on the heap, hence they're not...
    See more | Go to post

    Leave a comment:


  • l034n
    replied to Addding folder in solution explorer
    in .NET
    You will have to add it in your .csproj file, like this:

    <ItemGroup>
    <Folder Include="MyNewF older\" />
    </ItemGroup>

    I agree with insertAlias on this as i can not see any point at all of what you want to do (unless you're building another VisualStudio, or some batch solution maker).
    But anyway, that's the way to add the folder in the solution.

    Cheers
    See more | Go to post

    Leave a comment:


  • l034n
    replied to How to "addhandler" in C#
    in .NET
    To add an event handler, you can write this in C#:
    form2.FormClosi ng += new FormClosingEven tHandler(form2_ FormClosing);

    Note that after writing +=, the intellisense (if you use VS) will tell you that you may press TAB to add the event (which will generate the rest of the line, and then if you accept the default name of your callback function you may just press TAB one more time and you have your callback function.
    For...
    See more | Go to post

    Leave a comment:


  • l034n
    replied to What am I coding in? Visual C++? .net? CLI???
    in .NET
    You could search for it like this:
    managed c++ pass by reference

    It's really managed by the CLR, but it's usually called just Managed C++ instead of C++/CLR and if you search for anything about it, use the term "managed C++".

    As for your problem with passing by reference, i saw the thread and i believe you have solved it by now, but here is a simple pass-by-reference example:

    C#:
    ...
    See more | Go to post

    Leave a comment:


  • l034n
    replied to What am I coding in? Visual C++? .net? CLI???
    in .NET
    Hello BahatiSiD and welcome to the programming world :)
    MFC (Microsoft Foundation Classes) is windows library that wraps some portions of the Windows API in C++ classes. You have many graphical components in MFC that you ay use if you choose "MFC Application" (or anything starting with MFC for that matter) as a template. It was introduced in 1992 with Microsoft C/C++ 7.0 compiler, so it's older that Windows Forms, but is still in...
    See more | Go to post

    Leave a comment:


  • [code=vbnet]private DataTable GetSimpleDataTa ble()
    {
    DataTable dt = new DataTable("MyTa ble");
    dt.Columns.AddR ange(new DataColumn[] { new DataColumn("Col umn1"), new DataColumn("Col umn2") });
    dt.Rows.Add(new string[] { "Row1Col1", "Row1Col2" });
    dt.Rows.Add(new string[] { "Row2Col1",...
    See more | Go to post
    Last edited by Frinavale; Oct 3 '08, 04:01 PM. Reason: added [code] tags

    Leave a comment:


  • l034n
    replied to Make intellisense in app
    in .NET
    You may inherit a control from the one you're using and make it have custom properties for the text color. In your derived control, set:
    this.DrawMode = DrawMode.OwnerD rawFixed;
    Then, when adding items, you may use properties or a function for that, but you'll have to keep some internal table (or even better make a custom class for the items that you're adding) that will keep track of the color of the words.
    Then, override OnDrawItem...
    See more | Go to post

    Leave a comment:


  • l034n
    replied to .NET dynamic assembly with a custom icon?
    in .NET
    Thanks for the pointer Plater. That is some progress in the right direction. Although i still can't seem to put all the pieces together, it was helpfull. I just wonder if i am going to solve this the way i am doing it (making assembly with Emit) and if it's even possible. There is a switch in csc.exe (/win32icon:<file >) which can be used to assign an icon, but then the whole point of using Emit is to make the assembly dynamically, not to redistribute...
    See more | Go to post

    Leave a comment:


  • l034n
    replied to .NET dynamic assembly with a custom icon?
    in .NET
    Thanks for the reply joedeene. Well, i did search on google for hours before i posted it here with no luck. The problem is that i need this done with System.Reflecti on.Emit, so it should be dynamic assembly generation on-the-fly with AssemblyBuilder . I know very well how to embed resources in the current assembly (or in it's res/resource file). The trouble comes when i want to make some of those embedded icons to be the actual exe icon once it's...
    See more | Go to post

    Leave a comment:


  • l034n
    started a topic .NET dynamic assembly with a custom icon?
    in .NET

    .NET dynamic assembly with a custom icon?

    I've been recently working on application that generates .net assemblies on-the-fly using the methods in System.Reflecti on.Emit. It works well, but i would like to also change the icon of my freshly baked exe, so it would not appear the default icon.
    The idea is to be able to embed the icon in the assembly, (i guess as a resource) and make that icon a default assembly icon. I am not talking about window icon that can be set on any window,...
    See more | Go to post
No activity results to display
Show More
Working...