|
Q1-if a system is in loggoff state and i call
GetUserName(..).
is the function fails,and return value is zero?
and how did i know that the system is in loggoff state?
//////////////////////////////////////////////////////////
Q2-how i will trap the WlxDialogbox and where msgina asks for the userid,password
and fill in the fields by my self?
can any body help me in this regard?
//////////////////////////////////////////////////////////
Q3-how did i find the system32 path programatically?
//////////////////////////////////////////////////////////
Q4-if i call BlockInput(true)
and then i want to use postmessage or sendmessages for keyboard and mouse
will these messages works?
/////////////////////////////////////////////////////
r00d0034@yahoo.com
r00d0034@yahoo.com
|
|
|
|
|
imran_rafique wrote:
Q3-how did i find the system32 path programatically?
I have no idea how you did that actually!
But I know how I did it!
Pass CSIDL_SYSTEM in the second parameter of SHGetFolderPath()
But look up that function in MSDN Library to get know it better.
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
hmmmmm
thats nice.
thanks for reply.
r00d0034@yahoo.com
|
|
|
|
|
I've been going through this site and it's articles for the last couple of months and I starting to find that I don't know as much about C++ as I thought I did. When it comes to articles dealing with templates and the more advanced topics I get lost so I'm wondering if anyone knows any good C++ books that covers the more advanced topics.
Thanks in advance.
- monrobot13
|
|
|
|
|
C++: The Complete Reference[^]
I like this one. It's not quite as terse as the one below. I find it more accessible.
The C++ Programming Language[^]
On the other hand, you can't beat this book. This will tell you whatn you can and can't do with C++.
I recommend buying both. They're excellent.
Jon Sagara
When I want something, I just go out and buy it. That makes me a go-getter.
-- My sister
|
|
|
|
|
First thanks for the response.
Second, the thing about the books you mentioned is that they start out from the basics and then go up. I'm looking for books that geared more towards the advanced topics. Books that don't have any (or very little) to do with the basic stuff.
Thanks again.
- monrobot13
|
|
|
|
|
You don't have to read the beginning stuff. You can skip right to the advanced topics...
Jon Sagara
When I want something, I just go out and buy it. That makes me a go-getter.
-- My sister
|
|
|
|
|
Modern C++ Design
Exceptional C++
More Exceptional C++
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
I really like the "Standard C++ Bible". It covers templates and all that specific C++ thing you want. And many good chapters about STL too!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
I highly recommend Modern C++ Design by Andrei Alexandrescu.
http://www.amazon.com/exec/obidos/ASIN/0201704315/qid%3D1039303732/sr%3D11-1/ref%3Dsr%5F11%5F1/103-5795742-0356630
Kuphryn
|
|
|
|
|
|
Thanks everyone for the replies.
- monrobot13
|
|
|
|
|
Check out Scott Meyers' "Effective C++" books.
|
|
|
|
|
Hi.
In general, is it more extensible to implement core C++ datatypes in 32bits and 64bits operating system, or should you implement the OS specific datatypes? For example, under Windows you can implement a DWORD (32bits unsigned integer). A DWORD is equal to C++ unsigned long.
I would like to know what is most extensible in terms of C++ design and implementation?
Lastly, what is the point of an int datatype in 32bits and 64bits OS? In 32bits OS, an int is equal to a long.
Thanks,
Kuphryn
|
|
|
|
|
Here's what I've learned when dealing with the int and long data types in C++:
1. int was designed to be as large as what the CPU can handle most efficiently. In Win16 or Win32, int is 16 or 32 bits. in 32-bit UNIX systems int is 32 bits.
2. On 64-bit systems (Win64 or UNIX) int is also 32 bits, I guess to make it easier to port 32-bit apps.
3. long is 32 bits in Win16 and Win32, as well as 32-bit UNIX.
4. On Win64, long is also 32 bits, whereas on UNIX, it's 64 bits (which is what you'd expect, and how it's represented in .NET and Java).
So my suggestion, for the sake of simplicity and portability, stick with int -- don't use long .
Regards,
Alvaro
Well done is better than well said. -- Benjamin Franklin
(I actually prefer medium-well.)
|
|
|
|
|
long is ( or was ?! ) a size qualifier for the int at the time of 16bits apps. ( samething for short ).
long and short are not really types!
Alvaro Mendez wrote:
4. On Win64, long is also 32 bits, whereas on UNIX, it's 64 bits (which is what you'd expect, and how it's represented in .NET and Java).
Are you sure ? I thought the int would be "scaled" according to the CPU ?
Max.
|
|
|
|
|
Maximilien wrote:
long and short are not really types!
although everyone treats them as such. No one ever writes signed long int when long works just as well.
--Mike--
Friday's GoogleFight results: Britney Spears 2,190,000 - Erica Weichers 23
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Maximilien wrote:
Are you sure ? I thought the int would be "scaled" according to the CPU ?
No. AFAIK, int remains 32-bit on Win64.
|
|
|
|
|
I believe the 64-bit CPU's coming out of Intel are still 32 bits wide in terms of their 'native' word size, but 64 bits in terms of memory addressing. int therefore stays 32 bits in Win64.
Software Zen: delete this;
|
|
|
|
|
I wrote an app that creates a web page. Now they want to print it out. The problem comes that the settings for everyones printing is set differently, ie margins, header/footer, and if print background is selected. Is there a way to send IE the paramiters I want to print for this page? Thanks in advance.
Darroll
|
|
|
|
|
I've got a control derived from the browser. My printing code looks like this -
HRESULT hr;
BSTR header_BSTR = ::SysAllocString(L"&w&b&b&p");
VARIANT header_variant;
VariantInit(&header_variant);
V_VT(&header_variant) = VT_BSTR;
V_BSTR(&header_variant) = header_BSTR;
BSTR footer_BSTR = ::SysAllocString(L"&d &t");
VARIANT footer_variant;
VariantInit(&footer_variant);
V_VT(&footer_variant) = VT_BSTR;
V_BSTR(&footer_variant) = footer_BSTR;
long index;
SAFEARRAYBOUND parameter_array_bound[1];
SAFEARRAY *parameter_array = NULL;
parameter_array_bound[0].cElements = 2;
parameter_array_bound[0].lLbound = 0;
parameter_array = SafeArrayCreate(VT_VARIANT,1,parameter_array_bound);
index = 0;
hr = SafeArrayPutElement(parameter_array,&index,&header_variant);
index = 1;
hr = SafeArrayPutElement(parameter_array,&index,&footer_variant);
VARIANT parameter;
VariantInit(¶meter);
V_VT(¶meter) = VT_ARRAY | VT_BYREF;
V_ARRAY(¶meter) = parameter_array;
hr = _Browser->ExecWB(OLECMDID_PRINT,OLECMDEXECOPT_DONTPROMPTUSER,¶meter,NULL);
if (!SUCCEEDED(hr)) {
VariantClear(&header_variant);
VariantClear(&footer_variant);
if (parameter_array != NULL) {
SafeArrayDestroy(parameter_array);
}
}
This code sets the header and footer for the page and then prints it. The _Browser value points to the IWebBrowser2 interface for the control. If I remember correctly, I found this stuff in an example in the MSDN.
Software Zen: delete this;
|
|
|
|
|
With CString, we can perform an operation something like:
CString strMarks;
strMarks.Format("I got %d marks",marks);
Can we perform similar operation using std::string ??? If yes, then how ???
|
|
|
|
|
Try this:
char buffer[200] = {0};
std::string str = "";
int i = 9;
sprintf(buffer, "\n\nThis is number: %d\n\n", i);
str = buffer;
printf(str.c_str());
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
Unfortunately, you can't. In concept of C++ std library you must use streams (like as stdout, stdin and etc). This method was perfectly described by Alexandrescu in his book "Modern C++...". But personally I like to use old good method as Format. And I have invented my own function. May be it will be useful for you
string_smart Format(cstr szText,...)
{
cstr szPtr=szText;
size_t lLen;
for (lLen=0;*szPtr; ++szPtr,(*szPtr=='%') ?lLen+=10:lLen++);
string_cstr strRes(++lLen);
va_list marker;
va_start( marker, szText);
while (_vsnprintf(strRes.buffer(),strRes.buffer_size()-1,szText,marker) <0 )
strRes.reserve(strRes.buffer_size()*2);
strRes.buffer()[strRes.buffer_size()-1]='\0';
strRes.recalc_len();
va_end( marker );
return strRes;
}
This function works with my class string_smart, but it is not hard to remake it for std::string
|
|
|
|
|
Yes you can, using the stringstream class:
#include <string>
#include <sstream>
ostringstream strm;
string strMarks;
strm << "I got " << marks << " marks" << ends;
strMarks = strm.str();
--Mike--
Friday's GoogleFight results: Britney Spears 2,190,000 - Erica Weichers 23
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|