User Profile

Collapse

Profile Sidebar

Collapse
dantz
dantz
Last Activity: Jul 3 '17, 04:46 AM
Joined: Oct 13 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • How to convert/marshall C Function and DLL Structure type to C#

    Hi,

    Can someone please help me convert my C structure/function into C#? I really need this badly...
    I believe I can call the DLL properly if I have able to correctly convert the function and marshal properly my structure.

    Here is my struct and the function that uses it:
    Code:
    typedef struct UIclient_info {
    	char name[50];
    	int age;
    	SECONDUSER *stParent;
    } FIRSTUSER;
    ...
    See more | Go to post

  • C# use of Unmanaged C Library, run time error when reading file

    Hi,

    I have an unmanaged C library that has calculation functions.
    The function has to open a binary file to get data reference.
    Then returns a "ReadError" or the result in a User defined structure

    Code:
    MyStruct Calculate(int itemid, int input1, int input2, double input3)
    {
    //initialize variable
    MyStruct *resultAns;
    double item1_result = 0;
    double item2_result
    ...
    See more | Go to post

  • How to test and simulate up to 1000 or more connections in FTP and WebService

    Hi,

    Client: XP,Vista, Windows 7 Pro
    - C# Express 2008
    Server: Windows Server 2008 R2

    Please give me suggestions and solutions how can I test my server/client setup.

    Currently my client program connects to FTP and Server(Webservi ce)

    Is there a way that I can test my server and FTP if they can support thousand or more users?

    What I have now is that, I...
    See more | Go to post

  • dantz
    replied to How to add an operation in callback?
    Sorry about this silly question.

    It just needed to map all the functions in the service and client side. Must take note the use of IsOneWay = true for void functions.

    Thanks
    See more | Go to post

    Leave a comment:


  • dantz
    started a topic How to add an operation in callback?

    How to add an operation in callback?

    HI Everyone,

    I am very new in WCF. My current task now is to create additional functions in the callback contract so my Server side can execute it in the Client side.

    My problem now is after I have added some new functions in my server callback, I am now updating the service refence in the client side. But then it just says

    "Metadata contains a reference that cannot be resolved..."
    ...
    See more | Go to post

  • dantz
    replied to Remove garbage data in byte[]
    Yup, It can work for me (The post #4). As of now that is how I implement it. So far it seems okay, so I will be using this as of now (I just hope there would be no other issues may come in the future.lolz)

    This is the only available method call that I need to use. Because it is an API from a hardware. So there is no choice but to really deal with it.

    Thanks a lot for your time GaryTexmo. It was nice having a conversation...
    See more | Go to post

    Leave a comment:


  • dantz
    replied to Remove garbage data in byte[]
    Hi GaryTexmo,

    Sorry, I forgot to get back to this topic.

    Yes, the desired result "98989"

    Here are the output in bytes:
    176,185,81,129, 201,128,255,200 ,40,95,232,181, 43,143,255,91,5 2,157,234,235,1 03,185,88,167,1 7,97,146,122,17 2,50,220,172,92 ,252,191,27,220 ,94,63,249,97,2 4,151,83,180,22 8,102,98,71,175 ,90,229,127,189 ,98,10,168,228, 169,196,218,18, 189,197,85,217, 136,165,73,195, 48,187,74,97,24 0,178,138,195,1 20,187,15,181,2 04,104,252,104, 106,101,131,0,9 2,60,140,84,29, 15,139,43,151,1 2,214,137,119,0 ,111,37,208,107 ,188,29,137,153 ,187,116,173,11 1,15,177,129,14 8,246,116,99,32 ,64,119,130,141 ,62,83,0,53,171 ,51,52,13,65,55 ,46,134,136,94, 18,58,189,193,2 35,156,49,242,7 8,216,136,19,10 2,159,4,238,199 ,148,237,158,20 3,148,21,209,35 ,237,228,238,14 6,144,138,142,1 92,98,245,46,56 ,251,221,206,20 6,35,41,89,230, 250,227,64,42,1 80,43,179,4,79, 180,156,22,202, 58,130,151,124, 247,212,120,87, 43,2,151,61,54, 16,125,66,113,7 1,252,58,57,136 ,44,191,240,161 ,15,255,30,42,4 7,167,146,164,1 78,125,212,237, 133,151,35,136, 180,231,34,178, 202,116,206,162 ,90,50,94,19,56 ,115,158,164,18 9,214,148,221,1 36,192,85,254,6 7,24,224,18,84, 89,187,210,71,1 61,43,107,231,1 21,146,208,212, 125,235,55,125, 129,253,183,166 ,151,140,43,207 ,162,62,215,164 ,129,48,82,24,2 15,1,35,25,166, 12,22,38,125,11 ,64,186,102,76, 157,166,94,15,1 95,72,55,153,15 ,240,31,49,150, 218,76,108,229, 44,236,64,30,35 ,113,219,164,16 0,94,160,75,34, 129,248,55,74,3 1,57,255,215,13 7,94,205,232,86 ,43,112,246,184 ,192,22,131,255 ,205,151,224,89 ,98,237,38,54,9 9,71,247,244,10 7,234,220,246,1 4,178,110,201,4 9,66,130,186,21 7,117,22,129,20 1,26,225,136,15 5,108,122,164,1 43,3,197,56,230 ,112,7,9,62,253 ,54,253,202,68, 192,231,125,10, 125,35,148,84,8 6,155,177,105,1 44,187,113,67,2 12,46,185,158,1 67,153,64,106,2 26,254,247,17,2 24,243,175,160, 9,234,13,135,11 8,154,228,85,14 8,154,129,179,1 5,42,222,234,19 3,135,104,127,1 54,251,154,137, 150,118,132,111 ,30,60,163,196, 68,191,30,102,2 42,171,139,156, 173,173,116,15, 44,220,10,113,9 9,14,196,42,215 ,138,37,215,79, 79,40,117,156,1 29,...
    See more | Go to post

    Leave a comment:


  • dantz
    replied to Remove garbage data in byte[]
    Hmm...a bit tough to copy and paste the data. When I use the text visualizer or message box to the string, it just return the correct string. But when I save it to file, the one below is what I get.

    Code:
    98989  oŽ    <      Tã- \µQo   (¯ ¨Ž     ±Á ¨Ž    tã- (¯ ¨Ž ÿÿÿÿP    µÁ P Ìã- hQoP }Qo‡FѪ¨Ž Lä-     èÔQ    0   0   €ê= èðQØã-
    ...
    See more | Go to post

    Leave a comment:


  • There were no solution found on this matter.
    Our side also did not try to update to newer version of Flash (which could have solve the bug but may incur other kind of bugs). Since our flash movie is just continuously playing, The flash movie will send a message to C# side to re-load the movie again. So far this solution works and we sticking to this at this time.

    Thanks.

    dantz
    See more | Go to post

    Leave a comment:


  • dantz
    replied to Remove garbage data in byte[]
    So far this is what I came up with. Is there any better solution than this?

    Code:
    byte[] mybuff = new byte[512];
    List<byte> listbuff = new List<byte>();
                
    API_Read(handle, block, mybuff);
                   
    foreach (byte buff in mybuff)
    {
      if (buff == 0)
      {
         break;
      }
      listbuff.Add(buff);
    }
    
    byte[] resultbuff = listbuff.ToArray();
    ...
    See more | Go to post

    Leave a comment:


  • dantz
    replied to Remove garbage data in byte[]
    Thanks for your reply.
    Yes, the garbage come after the API call
    See more | Go to post

    Leave a comment:


  • dantz
    started a topic Remove garbage data in byte[]

    Remove garbage data in byte[]

    Hi,

    I am having difficulties on how I can remove all the "\0" (and all other garbage stuffs) in my variable.

    Code:
    byte[] mybuff = new byte[512];
    API_Read(handle, block, mybuff);
    After calling the API, mybuff will return something that I will convert to string by using this

    Code:
    string newStr = Encoding.ASCII.GetString(retbuff);
    However,...
    See more | Go to post

  • Winforms-Flash Interop: White background error with exclamation point

    HI Everyone! Hope someone can help me.

    I am loading a flash movie using the AxShockwaveFlas hObjects Reference.
    Then after sometime a white background will just show (no more movie) with circle that have Exclamation Point image in the middle.
    I have been using this method since flash player version 9.0. So I assume the latest flash version has something to do with it.

    Does anyone have any suggestion or...
    See more | Go to post

  • My keyboard will always be full screen which is 1680x1050.
    My key buttons are also 100x100 so no need to stretch the image layout of the button (picture box)
    See more | Go to post

    Leave a comment:


  • Its 6kb each..having 100x100 dimension.

    Hmm..maybe i need to try it one more time. There is probably some other cause why it resulted to be like that. Showing the form in modal doesn't have any effect right?...
    See more | Go to post

    Leave a comment:


  • tlhintoq: Thanks for this suggestion. Is the loading from file and loading from .resx have any differences? Because at start I was adding the images in an outside directory but there is one instance that when I load a form while loading its image contents from file (keyboard kind of form), I had seen some flickering before the form shows completely. Then each keys in that form are somewhat showing one by one (that somehow looks like I am animating...
    See more | Go to post

    Leave a comment:


  • Frinavale: I am just guessing. Because right now my application is already having a big memory consumption. So I am not sure if this is a cause of the way I am using images through timer or because of all the objects that are persistent since my app loaded. As of now if I redesign my application there isn't much enough time to do it, So now what I am doing is atleast trying not to extend more on that memory usage....
    See more | Go to post

    Leave a comment:


  • vishal1082: I am using images because the display for Chinese and Japanese text doesn't look nice..That was my solution to deal with those double byte characters because the UI must look really nice (~even though i know resources file size will suffer)...
    See more | Go to post

    Leave a comment:


  • Thanks for all the replies



    tlhintoq: Nope it is not a training game. The reason for supporting 2 language is to let users choose which language they are comfortable with.
    (I am just actually following a user requirement. If I will be deciding on the language I will just use the local language where my application will be shipped)...
    See more | Go to post

    Leave a comment:


  • The memory is roughly around this size 400-600mb...
    It is a game manager that handles flash games
    Inside the game manager got 10 picturbox that have timer to do animation by changing images. 1 of the picturebox change images every 50ms interval of the timer, while others are using 100ms interval.

    For changing of language, the trigger will be during run-time.
    I have something like a system menu where the user can...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...