|
I want to be able to generate a CLSID, but I always want the first 4 sections (best case) to be the same like so:
51eb18c0-98a7-11d1-83d1-f46705c10000
51eb18c0-98a7-11d1-83d1-f46705c10001
51eb18c0-98a7-11d1-83d1-f46705c10002
51eb18c0-98a7-11d1-83d1-f46705c10003
I need this to happen regardless of the machine's on a network or not. The first four sections should be different for each machine the program is run on as well.
Is this possible?
To hell with those thin-skinned pillow-biters. - Me, 10/03/2001
|
|
|
|
|
Just dug this up....
"For security reasons, UuidCreate was modified so that it no longer uses a machine's MAC address to generate UUIDs. UuidCreateSequential was introduced to allow creation of UUIDs using the MAC address of a machine's Ethernet card."
Norm Almond
Chief Technical Architect
FS Walker Hughes Limited
|
|
|
|
|
That might be exactly what I want.
Thanks Norm.
To hell with those thin-skinned pillow-biters. - Me, 10/03/2001
|
|
|
|
|
I can't use that. It needs to be supported under Windows 98 as well.
To hell with those thin-skinned pillow-biters. - Me, 10/03/2001
|
|
|
|
|
UuidCreateSquential is not defined in the specified header file, and I can't find it anywhere in the VC or sdk source files.
To hell with those thin-skinned pillow-biters. - Me, 10/03/2001
|
|
|
|
|
It's in Rpcdce.h...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Not in mine...
To hell with those thin-skinned pillow-biters. - Me, 10/03/2001
|
|
|
|
|
but I always want the first 4 sections (best case) to be the same
No, because that's not how GUIDs are defined. The first 10 bytes are a counter (number of 100ns intervals since some date long in the past, plus some other stuff to account for daylight savings time changes) and the last 6 bytes are the computer's MAC address (or a synthesized number for machines w/o a network card). So you must not change the last 6 bytes on your own or you risk duplicating a GUID made on another machine.
If you can change your requirements so that the first part can be incremented, that's ok. You could then have:
51eb18c0-98a7-11d1-83d1-f46705c10000
51eb18c1-98a7-11d1-83d1-f46705c10000
51eb18c2-98a7-11d1-83d1-f46705c10000
and so on. (This is what the Guidgen util does, BTW.)
--Mike--
http://home.inreach.com/mdunn/
"The Earth is doomed." -- Rupert Giles
your with and
|
|
|
|
|
Either way (I was going on memory - I thought the first 4 parts were identical from a given machine).
In either case, I can't find UuidCreateSequential *anywhere* in the vs6 or sdk code. I checked the rpcdce.h file but that function prototype (or macro) is not defined.
I've run guidgen, and it generates completely different guid's every time (it uses CoCreateGuid).
To hell with those thin-skinned pillow-biters. - Me, 10/03/2001
|
|
|
|
|
According to the July MSDN
Windows NT/2000 or later: Requires Windows 2000 or later.
Windows 95/98/Me: Unsupported.
Header: Declared in Rpcdce.h.
Library: Use Rpct4.lib.
It's on line 1707 of rpcdce.h on my copy of the SDK ( which is always the most recent, unless the CD hasn't come yet ).
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
It's on line 1707 of rpcdce.h on my copy of the SDK ( which is always the most recent, unless the CD hasn't come yet ).
Line 1716 in the latest downloadable version
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
I guess I'm stupid - I wandered around for almost 30 minutes on the Microsoft web site and couldn't find a place to download the latest sdk.
To hell with those thin-skinned pillow-biters. - Me, 10/03/2001
|
|
|
|
|
Try here
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
I guess I'm gonna have to snag the msdn cd from work. I don't have any activeXcrement/jhava/plugin stuff turned on, so I can't download it.
To hell with those thin-skinned pillow-biters. - Me, 10/03/2001
|
|
|
|
|
Well, on the download page, which I posted the link to, there is links to .cab flies that you can download. Just good old plain files, that even Linux knows how to download
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
If your browser won't show the links, just mail me and I'll send you the direct file-links
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
I snagged the June 2001 SDK CD from work. I have the correct RPCDCE.H files on my hard drive at work (installed February 2001 SDK a month ago), so I'm assuming that the June 2001 CD will have the same (or better?) files.
Thanks anyway Anders.
To hell with those thin-skinned pillow-biters. - Me, 10/03/2001
|
|
|
|
|
Hi..
I'm a newbie and I have a question...
these I do at the creation of X
int X[10] = {10,20,30,40,50,60,70,80,90,100,0};
but how can I Init X later in my program.
For Example:
int X[10];
int main()
{
X[] = {10,20,30,40,50,60,70,80,90,100,0}; // whats wrong with this line?
return 0;
}
|
|
|
|
|
int main()
{
for (i = 0; i < sizeof(x) / sizeof(int); i++)
x[i] = (i+1) * 10;
}
Should do the trick,
Norm Almond
Chief Technical Architect
FS Walker Hughes Limited
|
|
|
|
|
|
ok so that's what you wanted to know.. i guess i thought too far ahead..
char *p="char *p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
Hard work has a future payoff. Laziness pays off now.
|
|
|
|
|
I think
int X[10]={10,20...,100,0} could also have been written as
int X[] ={10,20,..,100,0} with the compiler calculating the size of X at compile time..
Now i guess what you are asking is that why doesn't the compiler allow u to init. the way you have shown..right?
hmmm...well the answer is lurking somewhere in my head..just can't seem to put it into words..
Well it's the way the language was defined...but i don't see any harm in having a construct to initialize compound data structures at run time..
Although in your case X[] would refer to the base address of X..so the line defintely won't compile..
char *p="char *p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
Hard work has a future payoff. Laziness pays off now.
|
|
|
|
|
I have a progrma now that uses ADO to read/modify/add to and delete records from a database.
My problem is two fold. First of all I want to create the database programatically, so I import ADOX like this:
#import "c:\Program Files\Common Files\System\ADO\msadox.dll" rename ("EOF", "adoxEOF")
Then I do this to create the database
HRESULT hr = S_OK;
ADOX::_CatalogPtr m_pCatalog = NULL;
ADOX::_TablePtr m_pTable = NULL;
try
{
TESTHR(hr = m_pCatalog.CreateInstance(__uuidof(ADOX::Catalog)));
char * pChar = new char[400];
memset(pChar, 0, 400);
sprintf(pChar, "Provider=Microsoft.JET.OLEDB.4.0;data source=%s;", (char*)DatabasePath);
m_pCatalog->Create(pChar);
delete [] pChar;
TESTHR(hr = m_pTable.CreateInstance(__uuidof(ADOX::Table)));
m_pTable->PutName("FileDatabase");
m_pTable->Columns->Append("FileName",ADOX::adVarWChar, 255);
m_pTable->Columns->Append("FilePath",ADOX::adVarWChar,255);
m_pTable->Columns->Append("FileLength",ADOX::adInteger,0);
m_pTable->Columns->Append("TimesDownloaded",ADOX::adInteger,0);
m_pTable->Columns->Append("LastModified",ADOX::adInteger,0);
m_pTable->Columns->Append("Frames",ADOX::adInteger,0);
m_pTable->Columns->Append("Seconds",ADOX::adInteger,0);
m_pTable->Columns->Append("Width",ADOX::adInteger,0);
m_pTable->Columns->Append("Height",ADOX::adInteger,0);
m_pCatalog->Tables->Append(
_variant_t((IDispatch *)m_pTable));
m_pCatalog->Tables->Refresh();
}
catch(_com_error &e)
{
_bstr_t bstrSource(e.Source());
_bstr_t bstrDescription(e.Description());
MessageBox(NULL, bstrDescription, bstrSource, 0);
return E_FAIL;
}
catch (...)
{
MessageBox(NULL, "General Error Creating Database", "Error", 0);
return E_FAIL;
}
return S_OK;
This works up to a point - the point I try to use it. It returns no errors and creates a file but neither my code or Access 2000 can read it. The other problem is if I create an empty table ( using Access ) this fails:
m_Connection.CreateInstance(__uuidof(Connection));
CComBSTR conStr = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=";
conStr.Append(DatabasePath);
bstr_t con(conStr);
HRESULT hr = (m_Connection->Open(con, "", "", adConnectUnspecified));
As soon as I add one dummy record, it succeeds.
So for now I must ship the Access DB with the program, I cannot create it, and the DB programatically ensures a dummy (meaningless) record exists and is hidden from the user. Surely this is not how it is supposed to work, so what am I doing wrong ?
Thanks
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
I have sorted out my ADO problem - apparently I need to check for a record count of 0 before calling MoveFirst();. Honestly, ADO seems designed to crash.
Anyhow, I'm still stuck on creating the DB from ADOX, and have been for some time, so any suggestions anyone has....
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
There is a great article located here:
http://codeguru.earthweb.com/controls/multiline_listbox.shtml
It has a simple CListBox with variable row height. Is there
any way of making an arbitrary row from that list viewable,
but unselectable??
Please, please, please, any response any one can give me will
be greatly appreciated.
Sincerely,
Danielle (an overworked graduate student)
|
|
|
|
|