Skip to content

C#

C# discussions

This category can be followed from the open social web via the handle c-065f1d12@forum.codeproject.com

93.7k Topics 383.1k Posts
  • 0 Votes
    1 Posts
    0 Views
    No one has replied
  • How do you create an object from a C++ DLL in C#

    question csharp c++
    2
    0 Votes
    2 Posts
    0 Views
    N
    No way to do this from C#. Either use MC++, or wrap your class into a COM object and the reference it from your code. I vote pro drink :beer:
  • File Icon and Type

    question
    3
    0 Votes
    3 Posts
    0 Views
    B
    you don't know a method to make it like VC++ - Initialize the ImageList with SHGetFileInfo - Make a GetShellIcon function return SHFILEINFO.iIcon - Make a function to find the type of the file I'm not sure but i think i can make it with a VC++ DLL and import it in C# !
  • Setting a timeout

    java tutorial question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Opening New Form

    csharp question asp-net help
    4
    0 Votes
    4 Posts
    0 Views
    A
    If you want to open it as a Modal Dialog Form2.Showdialog() or Form2.Show() to open it as a form (or no modal dialog) Remember to reference your other form. Hope this helps. Andres Manggini. Buenos Aires - Argentina.
  • Events

    hardware question
    3
    0 Votes
    3 Posts
    0 Views
    E
    how do you automate this is VS.NET??
  • call winapi in c#

    help csharp json
    2
    0 Votes
    2 Posts
    0 Views
    L
    when is use this code in VB6.0 it works but when i try to import the functions via C# (dllimport) it doesn't work //VB6.0 code Option Explicit Private Type DOCINFO pDocName As String pOutputFile As String pDatatype As String End Type Private Declare Function ClosePrinter Lib "winspool.drv" (ByVal _ hPrinter As Long) As Long Private Declare Function EndDocPrinter Lib "winspool.drv" (ByVal _ hPrinter As Long) As Long Private Declare Function EndPagePrinter Lib "winspool.drv" (ByVal _ hPrinter As Long) As Long Private Declare Function OpenPrinter Lib "winspool.drv" Alias _ "OpenPrinterA" (ByVal pPrinterName As String, phPrinter As Long, _ ByVal pDefault As Long) As Long Private Declare Function StartDocPrinter Lib "winspool.drv" Alias _ "StartDocPrinterA" (ByVal hPrinter As Long, ByVal Level As Long, _ pDocInfo As DOCINFO) As Long Private Declare Function StartPagePrinter Lib "winspool.drv" (ByVal _ hPrinter As Long) As Long Private Declare Function WritePrinter Lib "winspool.drv" (ByVal _ hPrinter As Long, pBuf As Any, ByVal cdBuf As Long, _ pcWritten As Long) As Long Private Sub Command1_Click() Dim lhPrinter As Long Dim lReturn As Long Dim lpcWritten As Long Dim lDoc As Long Dim sWrittenData As String Dim MyDocInfo As DOCINFO lReturn = OpenPrinter(Printer.DeviceName, hPrinter, 0) If lReturn = 0 Then MsgBox "The Printer Name you typed wasn't recognized." Exit Sub End If MyDocInfo.pDocName = "AAAAAA" MyDocInfo.pOutputFile = vbNullString MyDocInfo.pDatatype = vbNullString lDoc = StartDocPrinter(lhPrinter, 1, MyDocInfo) Call StartPagePrinter(lhPrinter) sWrittenData = "How's that for Magic !!!!" & vbFormFeed lReturn = WritePrinter(lhPrinter, ByVal sWrittenData, _ Len(sWrittenData), lpcWritten) lReturn = EndPagePrinter(lhPrinter) lReturn = EndDocPrinter(lhPrinter) lReturn = ClosePrinter(lhPrinter) End Sub :confused: :confused: :confused: :confused:
  • C# profiling tool

    csharp debugging performance question
    2
    0 Votes
    2 Posts
    0 Views
    S
    Sorry, I got this to work. Check it out here Cheers, Simon X-5 452 rules.
  • Font style

    question
    10
    0 Votes
    10 Posts
    0 Views
    J
    Mazdak wrote: you should use singular 'FontStyle' Oh man, today isn't my day! Earlier this morning I made another mistake in the data class thread. Maybe thats a sign that I should go to sleep! :) James Sonork ID: 100.11138 - Hasaki "My words but a whisper -- your deafness a SHOUT. I may make you feel but I can't make you think." - Thick as a Brick, Jethro Tull 1972
  • Accessing Data stored in a class

    database question announcement
    10
    0 Votes
    10 Posts
    0 Views
    J
    Gavin_Mannion wrote: maybe now I can get back on schedule with this project... Good luck :) James Sonork ID: 100.11138 - Hasaki "My words but a whisper -- your deafness a SHOUT. I may make you feel but I can't make you think." - Thick as a Brick, Jethro Tull 1972
  • click/doubleclick event paradox

    question help
    3
    0 Votes
    3 Posts
    0 Views
    S
    Thanks again James, that should work beautifully. Regards Senkwe Just another wannabe code junky
  • Security in webservices

    question security
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Add control dynamically

    csharp tutorial question
    7
    0 Votes
    7 Posts
    0 Views
    J
    lol, I can't believe I missed that! At least you have it figured out now :-) James Sonork ID: 100.11138 - Hasaki "My words but a whisper -- your deafness a SHOUT. I may make you feel but I can't make you think." - Thick as a Brick, Jethro Tull 1972
  • Porting MFC to UNIX

    c++ com help
    2
    0 Votes
    2 Posts
    0 Views
    C
    Most of those are found in STL, which is what you will have to learn before porting. Some have no direct companion, and you will have to write a port or change the code. // Rock
  • Transparent backgrounds for controls

    csharp graphics data-structures help tutorial
    5
    0 Votes
    5 Posts
    0 Views
    P
    Thanks to the 2 people that helped me out. Neither solution really helped that much, but I did learn, so that's a good thing. In the end, to remove background rectangles, I made one big background rectangle and drew everything on that, in other words, I painted everything on one canvas (instead of one canvas per game character). This seems to have done the job nicely. If anyone wants to see the finished code, drop me a mail. :rose: Jase:rose: Jason King jason.king@profox.co.uk Feel the love at www.profox.co.uk
  • remote installation of a Windows service

    csharp tutorial
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • performance question

    performance question beta-testing
    3
    0 Votes
    3 Posts
    0 Views
    R
    Uninstalled and reinstalled the framework and it's fixed. takes only a couple seconds to fire up the first time. Pretty much instant the second time.
  • Programmatically pressing F1 key on keyboard

    help question
    2
    0 Votes
    2 Posts
    0 Views
    L
    keybd_event(VK_F1, 0x45, 0,0); keybd_event(VK_F1, 0x45, KEYEVENTF_KEYUP,0); ================= Or something like that: GL Igor
  • Populating and Viewing Arrays

    question data-structures tutorial
    2
    0 Votes
    2 Posts
    0 Views
    P
    To find the length of an array, use the Length property: String[] arr = new String[5]; Console.WriteLine("The array length is {0}.", arr.Length); When you exceed the capacity of your array, you will have to allocate a new array and copy the contents of the old array to the new. You can automate this process by using the System.Collections.ArrayList class which will resize the array when necessary. -- Peter Stephens
  • AxHost, but on C site...

    csharp c++ com docker
    3
    0 Votes
    3 Posts
    1 Views
    L
    As I understand cumbersome case, would be to write my own wrapper... I'm thinking that maybe idiotic, but still valid solution would be to create instance of WebBrowser, persist it with tag that has dynamic CLSID of corresponding C# Object... After that enumerate DHTML and extract IDispact of that element... Very possible... But, Isn't that crazy??? Strange those "young inventors" or "gurus" are forcing us to reinvent the bycicle??!!!... However, solution is there => I hope they don't have plans to rewrite WebBrowser on C# (even on C it's still pretty slow considering DHTML realtime rendering)... Wow, what a bunc of IDIOTS!!!... Or maybe we both don't understand something!!!...