NO

Author Topic: IID_IADsUser  (Read 4915 times)

drhoule

  • Guest
IID_IADsUser
« on: March 16, 2011, 04:37:39 PM »
POLINK: error: Unresolved external symbol '_IID_IADsUser'.

#include <stdlib.h>
#include <objbase.h>
#define INITGUID
#include <initguid.h>
#include <objidl.h>
#include <iads.h>
#include <adsiid.h>
#include <Adshlp.h>

#include <windows.h>

#pragma comment (lib, "ole32.lib")
#pragma comment (lib,"oleaut32.lib")
#pragma comment (lib,"uuid.lib")
#pragma comment (lib,"activeds.lib")



still get Unresolved is there a utility to create a uid lib?

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2115
Re: IID_IADsUser
« Reply #1 on: March 16, 2011, 07:10:16 PM »
This may help you:
from iads.h at this line
MIDL_INTERFACE ("3E37E320-17E2-11CF-ABC4-02608C9E7553") IADsUser:public IADs {
Code: [Select]
CLSID const IID_IADsUser = { 0x3E37E320, 0x17E2, 0x11CF, 0xAB, 0xC4, 0x02, 0x60, 0x8C, 0x9E, 0x75, 0x53 };
You can use this program to generate clsids from iads.h
Code: [Select]
#include <stdio.h>
#include <string.h>

int main(int argc, char **argv)
{
FILE *fi;
char *pChr1, *pChr2, *pChr3;
char szRow[100];
char szTmp[100];

if (argc < 2)
{
printf("Usage:\n%s file\n", argv[0]);
return 1;
}
if ((fi = fopen(argv[1], "r")) == NULL)
{
fprintf(stderr, "Can't open file '%s'\n", argv[1]);
return 1;
}
while (!feof(fi))
{
if (!fgets(szRow, sizeof(szRow), fi))
break;
//if ((pChr1 = strstr(szRow, "MIDL_INTERFACE (\"")) != NULL) {
if (szRow[0] == 'M' && !strncmp(szRow, "MIDL_INTERFACE (\"", 17))
{
strcpy(szTmp, "CLSID const IID_");
pChr1 = &szRow[17];
//pChr2 = strstr(szRow, "\") ");
pChr2 = &szRow[55];
pChr3 = strstr(&szRow[56], ":public");
*pChr3 = 0;
strcat(szTmp, pChr2);
strcat(szTmp, "={0x");
strncat(szTmp, pChr1, 8);
strcat(szTmp, ",0x");
strncat(szTmp, pChr1 + 9, 4);
strcat(szTmp, ",0x");
strncat(szTmp, pChr1 + 14, 4);
strcat(szTmp, ",0x");
strncat(szTmp, pChr1 + 19, 2);
strcat(szTmp, ",0x");
strncat(szTmp, pChr1 + 21, 2);
for (int i = 24; i < 24 + 12; i += 2)
{
strcat(szTmp, ",0x");
strncat(szTmp, pChr1 + i, 2);
}
strcat(szTmp, "};");
printf("%s\n", szTmp);
}
}
fclose(fi);
return 0;
}
« Last Edit: March 17, 2011, 05:49:54 AM by timovjl »
May the source be with you