Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
V

veselin_iordanov

@veselin_iordanov
About
Posts
8
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Unmanaged Dlls ?
    V veselin_iordanov

    No exeptions Just not getting a return value back

    C# csharp c++ tutorial question

  • Unmanaged Dlls ?
    V veselin_iordanov

    dll is in the same directory but C# code dont work in this way

    C# csharp c++ tutorial question

  • Unmanaged Dlls ?
    V veselin_iordanov

    typedef BYTE *BBSTR; BBSTR AllocString(UINT len) { return (BBSTR) SysAllocStringByteLen(NULL, len); } void ReAllocString(BBSTR *pbbstr, UINT len) { BBSTR tstr; tstr = AllocString(len); if(len > StringLen(*pbbstr)) len = StringLen(*pbbstr); if(len > 0) memcpy(tstr, *pbbstr, len); FreeString(*pbbstr); *pbbstr = tstr; } BBSTR __stdcall decode(BBSTR data) { UINT i, j; BBSTR outstr; outstr = AllocString(StringLen(data) - 1); i = 0; j = 0; while(i + 1 < StringLen(data)) { //first to 2nd last char if(data[i] == 0x07) { i++; outstr[j] = data[i] ^ 0x0F; } else { outstr[j] = data[i]; } i++; j++; } ReAllocString(&outstr, j); return outstr; } in VB this is defined like Public Declare Function decode Lib "endecode.dll" (ByVal Data As String) As String in C# [DllImport("endecode.dll",CharSet=CharSet.ASCII, CallingConvention=CallingConvention.StdCall)] static public extern string decode ([MarshalAs(UnmanagedType.LPStr)] string Data) ; but dont work

    C# csharp c++ tutorial question

  • Unmanaged Dlls ?
    V veselin_iordanov

    i try it result is the same :(

    C# csharp c++ tutorial question

  • Unmanaged Dlls ?
    V veselin_iordanov

    no error just dont retutn anything

    C# csharp c++ tutorial question

  • Unmanaged Dlls ?
    V veselin_iordanov

    ok i have this case and try almost everething and dont work .. C++ Dll: typedef BYTE *CCSTR; CCSTR __stdcall Example(CCSTR data) { //do somthing } C#: [DllImport("test.dll",CharSet=CharSet.Auto, CallingConvention=CallingConvention.StdCall)] static public extern string Example([MarshalAs(UnmanagedType.LPStr)] string Data) ; if someone have idea what can be wrong that will be very cool 10x in advance PS: Sry about my bad english

    C# csharp c++ tutorial question

  • Array of pointers to a functions
    V veselin_iordanov

    found the problem 10x alot i must call function in this way (this->*handler[i])(data); .. dont know way its look totaly stuped for me .. but its work :D 10x for the help

    C / C++ / MFC help data-structures

  • Array of pointers to a functions
    V veselin_iordanov

    ok i have very strange problem in first case everything is ok int (*handler[15])(int parm); int user_trans_quit(int parm); int user_trans_quit(int parm){ printf("Just a test %d", parm); return 0; } int _tmain(int argc, _TCHAR* argv[]) { handler[1]=user_trans_quit; handler[1](1); } but when i try to meke OO compiler give me this error "error C2064: term does not evaluate to a function taking 1 arguments" #pragma once class PacketHandler { private : public: PacketHandler(void); ~PacketHandler(void); int LoginAck(char *parm); void Action(int i, char *data); int (PacketHandler::*handler[255])(char *parm); }; .... #include "StdAfx.h" #include ".\packethandler.h" PacketHandler::PacketHandler(void) { handler[1]=LoginAck; } PacketHandler::~PacketHandler(void) { } int PacketHandler::LoginAck(char *parm) { return 0; } void PacketHandler::Action(int i, char *data) { handler[i](data); //error C2064: term does not evaluate to a function taking 1 arguments } 10x in advance PS:sry about my bad english

    C / C++ / MFC help data-structures
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups