|
That's just cruel
Seriously, when was the last time you saw a "NO CARRIER" error halfway through a transmission?
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
waldermort wrote: This would give a total of 120 cards. Now if you were to choose 14 cards from those 120, how many combinations would there be without repeats and disregarding the order.
120! 6.68950E+198
------------ = ------------ = 6.69414E+17
14!(120-14)! 9.99308E+180
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
Show-off! I had to write all that code to get the answer...!
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
whats the C function from C standart libs to convert from wchar_t string to char string.
Is it just simle to do it this way:
for(i=0; i
|
|
|
|
|
and from char to wchar_t string also?
9ine
|
|
|
|
|
wctomb or mbtowc
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
To my knowledge, there are no "standard C" ways to do that, but there are two functions in the Win32 API that you will want to look at: MultiByteToWideChar(...) and WideCharToMultiByte(...) .
Peace!
-- modified at 9:14 Thursday 16th February, 2006
Whoops - guess I was mistaken given what Alok posted... My knowledge has expanded!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
James R. Twine wrote: Whoops - guess I was mistaken given what Alok posted... My knowledge has expanded!
You were not mistaken. The functions that Alok posted are CRT wrappers of the functions you posted. There are also the ATL conversion macros ( A2W, W2A, T2A, T2W, ect.) which also end up calling MultiByteToWideChar or WideCharToMultiByte.
You may be right
I may be crazy
But it just may be a lunatic you’re looking for
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
Thanks! Actually, I figured as much by the names of the functions (mbtowc - MultiByteToWideChar ), but since the function is declared in <stdlib.h> , and you need to link in the C Runtime Library to get at it, I thought it qualified as "standard" (even if it is Win32/Win64 "standard") .
Thanks!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
I want to uniquely identify a given system based on a set of parameters like ethernet address etc. Could some please provide me with a list of uniquely identifiable params Also I would like to collect the same details for Windows OS.
Also I see that some of these params need either a COM interface to query for or one have to code in assembly to retrieve them. Could someone provide with Windows SDK method of querying these params?
|
|
|
|
|
I do not think that there is a perfect way to do this. Many things that one would normally think of, the the MAC address, can be changed (at least, some NIC cards allow you to change the MAC address).
And I think that other things, like a CPU or a drive serial number, can be spoofed with the right (driver level) software.
You might be better off generating and managing IDs from a central location and assigning them to target systems yourself.
Whatever you do, please do not use this for something like software activation - it is a serious pain in the ass to disable something in Device Manager and make Windows Activation lose its mind...!
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
The second line aliases the keyword new to DEBUG_NEW, which is itself a macro defined in the Microsoft-specific header afx.h. DEBUG_NEW references THIS_FILE and __LINE__, thereby capturing the faux new's source context for possible tracing and debugging.
----
Can any one pls. explain the purpose of undef in the code above.
This code is almost present in almost in every file, in debug version after debug new is defined, THIS_FILE is used in debugging only then undef is un-defining it then what is the purpose of THIS_FILE.
Rgds,
Arun.
|
|
|
|
|
#undef simply says to the preprocessor that the THIS_FILE macro is not defined anymore after this point of reading...
the same question was asked yesterday... see this[^]
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VCalc 3.0 soon...]
-- modified at 5:13 Thursday 16th February, 2006
|
|
|
|
|
Yes, I have seen that but couldn't understand that.
Infact this code or the pre-processor directive is excuted in the beginning of the file, if we undef THIS_FILE and defining it again what might have been the value before and now for debugging purposes it's changed to be __FILE__.
can you pls. elaborate what is the value before undefining it.
Rgds,
Arun.
|
|
|
|
|
arunperi wrote: what is the value before undefining it
why do you need to know that ?
i don't know !!
maybe defined without value...
#define THIS_FILE
look in your headers to find the correct definition...
even MSDN[^] don't say much...
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VCalc 3.0 soon...]
-- modified at 5:36 Thursday 16th February, 2006
|
|
|
|
|
Thank you,
just trying to figure out what could be the purpose of that statement
Rgds,
Arun.
|
|
|
|
|
it's there to prevent the compiler from complaining about multiply-defined macros, in case something else in the #include chain has defined something with that same name.
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
hy everybody,
i really have a strange problem, and i hope that this very nice forum can help me out another time.
So what i have is a very simple com dll, if followed this article to build it: COM-DLL
my prroblem is, when e have a function like this:
[id(5), helpstring("method test2")] HRESULT test2([out,retval] BSTR* str);
i want to return more Parameters with the [out,retval], not only a BSTR* maybe a sequence or an array would be nice! In my Project i have to return 20 Strings to the Client who is using this dll, how does this work?
maybe something like this:
[id(5), helpstring("method test2")] HRESULT test2([out,retval] BSTR* str[20]);
I dont know or passing a sequence or an struct as a return Parameter?
Or what about this VARIANT* Types how does this work?
[id(5), helpstring("method test2")] HRESULT test2([out,retval] VARIANT* );
Please could someone explain it to me, i really need this asap...
Really, thank you in advance,
greetz
Balu
|
|
|
|
|
Since only one parameter (the last one) can be a retval parameter, you can only return one item - but this item can be a array of objects (SAFEARRAY packaged in a VARIANT , perhaps?).
You can try a retval of a VARIANT parameter and build a SAFEARRAY into it. Check the MSDN example for SafeArrayCreateEx(...) , it provides an example of creating a SAFEARRAY and putting it into a VARIANT .
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
Sorry i cant unterstand this mapping of an safearray to variant, i rather dont know where to put that code? Must be in the idl file, because the interface have to know it!?
But i really dont know how to do that!
If someone has an example on how to implement a safe array as a retval of a COM function defined in an idl file!
Or another solution for the problem from the first thread!
greetz
Balu
|
|
|
|
|
My IDL is rusty, so this may not be exactly right, but I think the parameter would be something like:
[out,retval] SAFEARRAY(BSTR)** str_array
SAFEARRAY is a IDispatch-compatible parameter so there's no need to put it in a VARIANT .
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
I am hosting an MSHTML browser control in my app via CHtmlView. Is it possible to get notified as it tries to download each page element (e.g. an image) and force it to instead get it from somewhere else?
It'd be nice if I could also intercept and replace the entire page itself. Right now, I'm doing this in OnBeforeNavigate2() by setting the cancel flag, calling Stop() and then calling Navigate() for the new URL
The two most common elements in the universe are Hydrogen and stupidity. - Harlan Ellison
Awasu 2.2 [^]: A free RSS/Atom feed reader with support for Code Project.
|
|
|
|
|
Hello,
one of our Networkers asked me, if MFC uses
the Internet Explorer SSL certificates?
I didn't found informations in the internet.
He told me that Java uses own certificates,
so he wanted to know.
Hope someone can help me
Thanx
Dannydust
P.S.: Greetings from Germany
|
|
|
|
|
I found the Answer!
The SOAP toolkit uses the same certificates as the IE.
Greetings
Dannydust
|
|
|
|
|
I want to communicate with USB port without using RS232 converter in VC/VB.
Please Help
Rujuta
|
|
|
|