|
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/netbios/netbios_1l82.asp
|
|
|
|
|
Thank You, - they are writing that it won´t work with Win98. Do you know something else wich will work on W98 too?
|
|
|
|
|
I think the operative word is reliably. You might want to try it in your environment to see how it behaves.
The GetAdaptersInfo() suggestion mentioned earlier will work. Here's a snippet:
IP_ADAPTER_INFO AdapterInfo[5];
PIP_ADAPTER_INFO pCurrentAdapter;
ULONG ulSize;
ulSize = sizeof(AdapterInfo);
if (GetAdaptersInfo(AdapterInfo, &ulSize) == ERROR_SUCCESS)
{
pCurrentAdapter = &AdapterInfo[0];
assert(NULL != pCurrentAdapter);
printf(" MAC Address = ");
for (UINT x = 0; x < pCurrentAdapter->AddressLength; x++)
printf("%02x ", pCurrentAdapter->Address[x]);
}
|
|
|
|
|
Thank you very much for that, hope I can help you one time..
Best regards from Munich/Germany, Andreas Niedermeier
|
|
|
|
|
I would like to know if on the rare occasion my app crashes, that instead of invoking drwatson32 on XP, and giving the lovely dialog to e-mail Microsoft, that it launches my own instead, so that it is easy for a customer to copy the log file to his own PC, and mail it to me from another PC. I then want to add additional info in my own app.
My wish-list is a couple of reg keys or APIs, and also to be able to use this on NT4 and Win 2000. I have seen some apps that got to town, but I just want the neat basics, not a full-blown heapwalk/process demo!
Conrad - conradb@adroit.co.za
Always do badly to start off, that way when you get the hang of it suddenly, everyone is surprised.
|
|
|
|
|
|
is it possible i could make any single item in the listbox "NON-CLICKABLE"???????
perhaps make any one on the items grayed of...disabled????where as the rest of the item are enabled??clickable??
any ideas???
With Regards
Joseph R. Thomas
Have a Super Blessed Day!
-------------------------
For God has not given us a spirit of fear, but of power and of love and of a sound mind.
2 Timothy 1:7
|
|
|
|
|
I've seen this done with a checklistbox, but not a regular listbox. You might could do it via an owner-draw listbox, but I'm not sure.
|
|
|
|
|
I don't know of a clean solution, but there's a workaround. When you detect such an item is selected, unselect it (and reselect the one that was previously selected, if any).
I do that in a web app where I have several listbox items acting as separators.
Regards,
Alvaro
Hey! It compiles! Ship it.
|
|
|
|
|
Hi!
I want to send a msg some way to remote machine on the occurance of some event on host machine such that a dialog box is shown on remote machine.
Pls help how can I do that. Remote machine is having a dll that has dialog and a exported function to show dialog, I just have to trigger that using rundll or what ever may be DCOM or something.
thanks
naveen
|
|
|
|
|
Sounds like a job for...RPC. I've not ever used it before so you'll have to search CP, MSDN, or the Net for examples.
|
|
|
|
|
RPC has a big problem.. it only works under nt/2k/xp!
Don't try it, just do it!
|
|
|
|
|
It's only a problem if you are targeting Windows 9x machines. Something is a problem if it behaves in an unpredictable or undesirable fashion. Since RPC does what it is supposed to, I see no problem.
|
|
|
|
|
Hi guys.
I am trying to import/link the MSXML.Dll from a class i have created in C++. Defined in the classes header file is a datamember of type IXMLDOMDocumentPtr. Certain functions in the class then use objects and functions in the MSXML.dll.
My code works fine if i "#define import 'dllPath'" in the header file. Problem is on a client machine i may not know the full path to the DLL.
I need a way of dynamically loadind the DLL so my class can access all its fucntions and objects.
I have tried using LoadLibary() but am not sure how it should be used to import a DLL into a class. The call to LoadLibary() has to be placed in the .cpp file and then i get errors form m y header file as IXMLDOMDocumentPtr cannot be found.
Sorry 4 the essay, hope someone can help.
Cheers
Simon Turner
|
|
|
|
|
Becase MSXML.dll implements a bunch of COM objects, you don't need to do an explicit LoadLibrary call. COM takes care of this for you when you CreateInstance a new instance of a coclass. You only need to know the class id or progid. COM looks up the rest in the registry.
That said, you obviously need to have the correct version of the MS XML parser installed on the client machine. Different COM class names map to different versions of the DLL.
Brad
|
|
|
|
|
I did realise about the different versions of the msxml.dll parser. That is why i was planing to pack the msxml.dll version 1,0 into my installer (as its the smallest in size)and then just put it somewhere on client machine. I could then import it via #define import"", but the path may vary unless i just put the DLL in C:/. That is why i wanted to laod it dynamically in code so i coudl use the regitry to find the path to the DLL.
|
|
|
|
|
Hmm...I think you may be a bit confused on how to program with COM ojbects and how they're used at run-time.
#import is used only at compile time to include declarations of objects supported by the COM DLL. The path is only relevant on the computer where your code is being compiled. This is very similar to #include.
At install time, you must register any COM components that you install. This adds entries to the registry that the COM APIs use to find the DLLs and create the proper execution environment for the components. Most COM DLLs export a function called DllRegisterServer which the DLL author must provide to perform the necessary registration steps. Most installer packages (InstallShield, Wise, etc.) will call this function if you specify the DLL as requiring registration. You can also register a component using the regsvr32.exe utility, which calls DllRegisterServer .
So, the path to the DLL is established at registration time and stored in the registry. You can install the DLL anywhere.
At run time, you instantiate an instance of a coclass by specifying either a CLSID or PROGID. The COM API CoCreateInstance (which is either called by the smart pointer, or by your code directly, depending on how you've written things), performs a lookup in the registry to find the location of the DLL.
A warning about installing MSXML yourself. With later versions of the parser, there are more than one DLL. I'm not sure about V1.0. You are probably better off finding out what installation method Microsoft recommendeds. They probably have an installation package that you can re-distribute. That installer will install all required components and perform the necessary registration.
Secondly, V1.0 is very old. Newer versions support more of the XML and related standards.
Finally, depending on what OS you're targetting, a version of the parser may already be installed.
HTH
Brad
|
|
|
|
|
Thanks for your help mate.
Cheers
|
|
|
|
|
i tried to register a .dll and i got the the following error :
Debug Assertion Failed!
Program:......REGSVR32.EXE
File: OLEFACT.CPP
Line: 122
can anybody help me out of what is the problem
pavan
|
|
|
|
|
Debug assertions typically aren't compiled into release code, so this likely is in the DLL rather than regsvr32.exe. As well, olefact.cpp is an MFC file, so likely not part of regsvr32.exe.
Try running the whole thing under the debugger so that you can break when the assertion trips and look at the call stack.
Brad
|
|
|
|
|
i know i can use ran function to generate a random number in VBScript.
for example:
/*
dim char_array(35)
char_array(0) = "0"
char_array(1) = "1"
char_array(2) = "2"
char_array(3) = "3"
char_array(4) = "4"
char_array(5) = "5"
char_array(6) = "6"
char_array(7) = "7"
char_array(8) = "8"
char_array(9) = "9"
randomize
do while len(output) < 6
num = char_array(Int(9 * Rnd + 0))
output = output + num
loop
*/
How can i get a random number in MFC?
Habbit--Beginner In MFC
|
|
|
|
|
void srand( unsigned int seed );
and to get the random number
int rand( void );
See the MSDn for more info
It is amazing what you can accomplish if you do not care who gets the credit. - Harry S Truman
|
|
|
|
|
if i limit the range of generated number from 1 to 35,how can i do?
Habbit--Beginner In MFC
|
|
|
|
|
A simple way would be to alter the output
nRand = rand() % 36;<br />
nRand = nRand == 0 ? 1 : nRand;
It is amazing what you can accomplish if you do not care who gets the credit. - Harry S Truman
|
|
|
|
|
easier will be
nRand=1+rand()%35
|
|
|
|