Gnutella Forums

Gnutella Forums (https://www.gnutellaforums.com/)
-   General Gnutella Development Discussion (https://www.gnutellaforums.com/general-gnutella-development-discussion/)
-   -   I'm stuck need help (https://www.gnutellaforums.com/general-gnutella-development-discussion/8420-im-stuck-need-help.html)

abhiexx February 24th, 2002 11:08 AM

I'm stuck need help
 
Hi !
i am a novice programmer......trying to code a gnutella clone for my class project..
I am facing trouble with using the GUID in the header....
My problem is :-

a) As the cocreateguid function returns a GUID structure....how do i convert that into a byte array sos that i can send it on it's way....the UUidtostring ()
function is not working for me.....is causing an exception in the application code.

b)Could anyone also please...clarify the purpose the GUID serves and how do i hanlde it in my application.....


----Thanks help will be highly appreciated....

Joetella February 25th, 2002 05:56 AM

Re: I'm stuck need help
 
Quote:

Originally posted by abhiexx
Hi !
i am a novice programmer......trying to code a gnutella clone for my class project..
I am facing trouble with using the GUID in the header....
My problem is :-

a) As the cocreateguid function returns a GUID structure....how do i convert that into a byte array sos that i can send it on it's way....the UUidtostring ()
function is not working for me.....is causing an exception in the application code.

b)Could anyone also please...clarify the purpose the GUID serves and how do i hanlde it in my application.....


----Thanks help will be highly appreciated....

Here is my Guid Code, a function which return a Byte array ..
note that you dont need to use CoCreateguid function!

Code:


Private Function Guid() As Byte()
   
  On Error GoTo HandleError
 
  Dim iPos As Integer
  Dim bTemp() As Byte
  ReDim bTemp(0 To 15)

' client guid
  Randomize
  For iPos = 0 To 14
      bTemp(iPos) = CByte((254 * Rnd + 1))
  Next iPos
  bTemp(7) = 255
  bTemp(15) = 0
  Guid = bTemp
  Exit Function
 
HandleError:
  LogError ("Guid")
  Resume Next
   
End Function


Unregistered February 25th, 2002 06:00 AM

is this Basic?

Joetella February 25th, 2002 07:13 AM

Yes it is.. Visual Basic

abhiexx March 1st, 2002 09:05 PM

Thanks !
 
hi!
Thanks for posting the solution!...I am using VC++..but ur post gave me some new ideas..anyway for those who are using the GUID struct....i think....just copying the struct members into a byte array would suffice....using the wsprintf and a format string consisting of %x...this is pretty dumb....but i think it works...:-)


All times are GMT -7. The time now is 08:36 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 ©2011, Crawlability, Inc.

Copyright © 2020 Gnutella Forums.
All Rights Reserved.