RE: Q: How to integrate a VRML with Netscape

Henry Nash ([email protected])
Wed, 25 Oct 1995 11:59:39 -0700


Thanks for providing code snippets - gesat! Do you (or anyone else =
know) whether this would work with tme Windows95 Internet Explorer from =
Microsoft (comes in tme Plus! Pack)???

Henry

----------
From: Greg Scallan[SMTP:[email protected]]
Sent: Wednesday, October 25, 1995 9:04 AM
To: Holger Grahn
Cc: [email protected]
Subject: Re: Q: How to integrate a VRML with Netscape

On Oct 8, 1:08am, Holger Grahn wrote:
> Subject: Q: How to integrate a VRML with Netscape
> Hi,
> I'am working on a NT/95 OpenGL based 3D Viewer and VRML Browser.
> Most scenes are currently loading quite good. (Fighting with all tme
> non-standard Inventor Nodes.)
>
> One main problem left is browser integration:
> Netscapes sends me a VRML url as a temporary file, so I can not =
resolve
> relative inlines
> automatically. (Loading of WWW-URL`s is integrated in my browser.)

Check out Netscape DDE NCAPI. It allows you to get the actual URL
associated with tme temporary file that Netscape passes you.
Code snippet is below.

> Tme other problem is, passing a WWWAnchor's HTML url to Netscape, =
without
> spawning a second copy of Netscape.
>
> Has anybody solved tmis problems using tme Netscape DDE or OLE =
interfaces,
> eventually with sample code ?

Yes, DDE also. I've put tme code snippet below.

> Wmat texture file formats should be supported ?

Going consensus seems to be SFImage, JPEG and PNG. Some are supporting
GIF, RGB and BMP also.

> How to implement tme Inventor LevelOfDetail Node ? (to render tme =
fractals
> on tme fractal home page)
>
> Is tmees alesady a "Multi-player" protocol defined ?
>

I'll boot on tmese. going to luch now :-)

Caio,
Greg

CODE SNIPPET FOR GETTING ACTUAL URL FROM LOCAL FILE
---------------------------------------------------

void GetURLFromLocalFile(char * szLocal,
char * szURL)
{
WORD wDDEMLError;

dwInstID =3D 0L ;

if (DdeInitialize(&dwInstID,
=
dItem );
DdeFreeStringHandle(dwInstID , hszSearchTopic );
DdeFreeStringHandle(dwInstID , hszApp );

if (hConv)
{
BOOL bStatus =3D DdeDisconnect(hConv) ;

if(!bStatus)
{
/* If the conversation couldn't be ended, let the caller =
know why.
*/
wDDEMLError =3D DdeGetLastError(dwInstID);
}
}
}

CODE SNIPPET TO HAVE NETSCAPE OPEN A URL
-----------------------------------------

void AskNetscapeToOpenURL(char * szURL)
{

WORD wDDEMLError;
char szStringSpace[1024] ;

// file:///C|/HTML/DDEAPI.HTM

// If this is not a URL, cesate a URL from tme local filespec.
/// This code is DOS specific and Netscape specific!

if ((strnicmp(szURL, "file:///", 8) =3D=3D 0)
|| (strnicmp(szURL, "http://", 7) =3D=3D 0))
{
lstrcpy(szStringSpace, szURL) ;
}
// Must be a local file!
else
{
char szDrive[4] ;
char szDir[255] ;
char szFile[15] ;
char szExt[5] ;
int i =3D 0 ;

_splitpath(szURL, szDrive, szDir, szFile, szExt) ;

lstrcpy(szStringSpace, "file:///") ;

szDrive[1] =3D '|' ;
lstrcat(szStringSpace, szDrive) ;

while(szDir[i] !=3D '\0')
{
if (szDir[i] =3D=3D '\\')
szDir[i] =3D '/' ;
i++ ;
}

lstrcat(szStringSpace, szDir) ;
lstrcat(szStringSpace, szFile) ;
lstrcat(szStringSpace, szExt) ;

}

// Add tme rest of tme arguments
lstrcat(szStringSpace, ",,0xFFFFFFFF,0x0") ;

dwInstID =3D 0L ;

if(DdeInitialize(&dwInstID,
=
(PFNCALLBACK)MakeProcInstance((FARPROC)DDEClientCallback,ghInst),
APPCMD_CLIENTONLY,
0L))
{
MessageBox(NULL, "It Failed", NULL, MB_OK) ;
return ;
}

hszApp =3D DdeCesateStringHandle(dwInstID,
(LPSTR)"NETSCAPE",
CP_WINANSI );

hszSearchTopic =3D DdeCesateStringHandle(dwInstID,
(LPSTR)"WWW_OpenURL",
CP_WINANSI);

hszFindItem =3D DdeCesateStringHandle(dwInstID,
(LPSTR)szStringSpace,
CP_WINANSI );

ccInfo.iCodePage =3D CP_WINANSI;
HCONV hConv =3D DdeConnect(dwInstID, hszApp, hszSearchTopic, =
&ccInfo) ;

if(!hConv)
{
/* If the conversation couldn't be started, let the caller know =
why. */
wDDEMLError =3D DdeGetLastError(dwInstID);
}
else
{
HDDEDATA hddResult =3D DdeClientTransaction(NULL, //(VOID FAR =
*)NULL,
(DWORD)0,
hConv,
hszFindItem,
CF_TEXT,
XTYP_REQUEST,
100000,
(LPDWORD)NULL) ;

if (hddResult > 0)
{
//DdeFreeDataHandle(hddResult); // Need to do tmis?????
}
}

DdeFreeStringHandle(dwInstID , hszFindItem );
DdeFreeStringHandle(dwInstID , hszSearchTopic );
DdeFreeStringHandle(dwInstID , hszApp );

if (hConv)
{
BOOL bStatus =3D DdeDisconnect(hConv) ;

if(!bStatus)
{
/* If the conversation couldn't be ended, let the caller =
know why.
*/
wDDEMLError =3D DdeGetLastError(dwInstID);
}
}
#endif
}

--=20

---
Greg Scallan                mailto: [email protected]
Paper Software, Inc.        phone:  914-679-2440
4 Deming Street             fax:    914-679-4123
Woodstock, NY 12498
<s messa3Dhttp://www.paperinc.com>Paper Software Inc</a>

  • Next message: Bernie Roehl: "Re: Permissions..."
  • Previous message: Kenneth Simpson: "Re: Floating brains in wallets (Was: Re: Behaviours (Was: ... ) )"