comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » IDL for Windows NT
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: IDL for Windows NT [message #3771 is a reply to message #3679] Fri, 10 March 1995 23:05 Go to previous messageGo to previous message
ade is currently offline  ade
Messages: 1
Registered: March 1995
Junior Member
This is my solution for the long filename data.

This simple DLL returns truncated uniq short filename
which IDL could use to read/write it.

I compiled this with BorlandC++ Ver4.5. I'm new for Windows NT programing
and IDL for NT doesn't have DLL example for NT, so I don't know whether
if this is correct esp. LibMain. I'm using this every day and seems fine.
Let me know if something wrong.

If someone needs DLL binary which is about 13Kbytes, send me a E-mail to
KYD00035@niftyserve.or.jp.

Hisa Noguchi

///// Top of sfname.pro ////////
function sfname, LongFileName

return, call_external('e:\dll\sfname\sfname.dll', 'sfname', LongFileName, /S_VALUE)

end
///// End of sfname.pro ////////

///// Top of sfname.c ////////
#include <windows.h>
#include <stdio.h>
#include <string.h>

static HINSTANCE hLibInst;

int FAR PASCAL LibMain (HANDLE hInstance, WORD wDataSeg, WORD wHeapSize,
LPSTR lpszCmdLine)
{
hLibInst = hInstance;
return 1;
}

long PASCAL sfname(long lArgc, LPVOID lpvArgv)
{
long *lplArgv;

LPCTSTR longname;
HANDLE hReturn;
char *lpstrReturn;
WIN32_FIND_DATA lpffd;
HANDLE hRetFind;

lplArgv = (long *)lpvArgv;

longname = (LPCTSTR)lplArgv[0];

hReturn = LocalAlloc(LPTR, 20);

if (!hReturn)
return (NULL);

lpstrReturn = (char *)LocalLock(hReturn);
if (!lpstrReturn) {
LocalFree (hReturn);
return (NULL);
}

hRetFind = FindFirstFile(longname, &lpffd);
FindClose(hRetFind);

lstrcpy (lpstrReturn, lpffd.cAlternateFileName);

/* Return a char * */
return ((LONG)lpstrReturn);
}
///// End of sfname.c ////////
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: Q regarding spawning in windows95
Next Topic: droplist widget for long lists with Unix/X

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 16:04:05 PDT 2025

Total time taken to generate the page: 0.00721 seconds