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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
P

Paul_591

@Paul_591
About
Posts
3
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • LPSTR and LPBYTE passing to a dll
    P Paul_591

    Fantastic. That seems to work a treat. However, on the inside of the dll, the first function is this.. API seed2key (char *param, BYTE *key) { BYTE seed[16]; DWORD i, retLen, seedLen; BYTE *scanPtr; i = 0; scanPtr = strtok(param, " \t\n"); while (scanPtr && i < 16) { seed[i] = atoi(scanPtr); scanPtr = strtok(NULL, " \t\n"); i++; } seedLen = i; seedToKey (seed, seedLen, key, &retLen); return (retLen); } the while loop iterates once through correctly, but on the second time the string tokenizer returns 0x0000000 into scanPtr. When you hover over it in VS, the tooltip says. [scanPtr = 0x00000000 ]. The above section of code seems to suggest that it is actually requiring a string with the delimeters " ", tab and newline. Rather confusing - although seemingly a different issue, any ideas? Thanks for the previous posts! Paul.

    COM question c++ com hardware data-structures

  • LPSTR and LPBYTE passing to a dll
    P Paul_591

    Thanks for that! I couldnt find that information anywhere on the web! The code snippet is below. It is VERY rough as I am hacking around to get a solution. :-) int main() { BOOL procReturn = 0; HINSTANCE dllHandle = NULL; KWP_COMPUTEKEYFROMSEED pSeedAndKeyFunc = NULL; dllHandle = LoadLibrary("seed_inv.dll"); if (!dllHandle) { cout<< "Failed to Load dll" << endl; } else { cout<< "DLL loaded OK" << endl; } if (dllHandle) pSeedAndKeyFunc = (KWP_COMPUTEKEYFROMSEED) GetProcAddress(dllHandle, "seed2key"); if (!pSeedAndKeyFunc) { cout<< "ProcAddress Failed"<

    COM question c++ com hardware data-structures

  • LPSTR and LPBYTE passing to a dll
    P Paul_591

    Guys, I am an accomplished embedded coder, but not very adept with windows programming or COM. However, I have a quick command line program to write to make use of a seed2key dll. The dlls prototype is.. API seed2key(char *seed, BYTE *key). I know this because I have the source code for it. However, when trying to use the seed2key function in a C++ console app, the compiler thinks that the parameters should be of type LPSTR and LPBYTE respectively. Unfortunately I have no idea what these are. I have a 16 byte array carrying the seed, that i need to pass to this function. How do i create an LPSTR from that? Does anyone have any idea what parameters it is actually after, and can provide me with a way to do so? Many Thanks to anyone who can help. Paul.

    COM question c++ com hardware 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