check floppy Drive
Hello To get the removable drives i have used GetDriveType ( ) function Is it possible to check whether a drive is floppy drive or not ? Please let me know your suggestions on this... Thank you dor any help ...
Hello To get the removable drives i have used GetDriveType ( ) function Is it possible to check whether a drive is floppy drive or not ? Please let me know your suggestions on this... Thank you dor any help ...
I have the following piece of code. This is written for getting the list of timezones from registry and populating into an array. This piece of code works fine in Win7 and Vista OS but not in WinXp and Win2k3. The reason is because of the size of array getting overflown. I have defined only 100 elements. However there are more than 100...
Actually I am hooking memory management functions but one problem that confronts me is that I am unable to get the pointer name for which memory is being allocated in my hooked function. I mean... suppose Myfunction() allocates memory to a pointer Myptr through new operator as geven below. Myfunction() { int * Myptr = new int; } Now h...
In my new project I wish to (mostly for to see how it will work out) completely ban raw pointers from my code. My first approach was to let all classes inherit from this simple class: template class Base { public: typedef std::shared_ptr ptr; }; And simple use class::ptr wherever I need a pointer. This ap...
Here is some C++ code: #include <iostream> using namespace std; class m { public: m() { cout << "mother" << endl; } }; class n : m { public: n() { cout << "daughter" << endl; } }; int main() { m M; n N; } Here is the output: mother mother daughter My problem is that I don't want the m's constructor to...
I always had trouble with estimating cost/price of finished software (or programming work), so here are two questions about it. question 1: You're asked to write a piece of code for cash (all rights to the code belongs to buyer once you're done). You know approximate number of hours it will take (+-25%), and approximate complexity (i....
I'm trying to wrap a class from a library I'm using in Lua. Specifially, I'm trying to wrap the color class from SFML. The full source for the color class can be seen here and here. This is the function that's that I'm failing in. int SFColor_new(lua_State* L) { // omitting part where I set r, g, b, and a new (lua_newuserdata...
In emacs 21: namespace Abc { namespace Def { class X; namespace Ghi { class Y; } } } But now in emacs 22.2.1: namespace Abc { namespace Def { class X; namespace Ghi { class Y; } } } How do I get the old behaviour back? Note that I don't want a fixed column for indentation...
I'm renaming a file using boost::filesystem, and sometimes the target file will exist. According to the boost documentation here: http://www.boost.org/doc/libs/1_42_0/libs/filesystem/doc/reference.html#Non-member-functions template void rename(const Path1& from_p, const Path2& to_p); Requires: Path1::external_string_type and ...
The Windows and Solaris thread APIs both allow a thread to be created in a "suspended" state. The thread only actually starts when it is later "resumed". I'm used to POSIX threads which don't have this concept, and I'm struggling to understand the motivation for it. Can anyone suggest why it would be useful to create a "suspended" thread...
I'm using error codes for handling errors in my c++ project. The problem is how to return error codes from a function which is supposed to return some variable/object. consider this: long val = myobject.doSomething(); Here, myobject is an object of some class. If doSomething function encounters some error condition then how should i...
I've been studying Visibility issue in PHP (public, private, protected) and wondered how is this sort of "dom-building" is implemented in PHP? I mean there should be some kind of algorithm that PHP uses to go through all your classes and establish relations between them. Not sure if it is called "dom-building" though, but I think the sam...
Hello everyone, The following code has been giving me some troubles for the past few hours. I'm trying to write a small program (based on some tutorials from the web), that uses a WH_JOURNALRECORD windows hook to log keystrokes. Main code: #include "StdAfx.h" #include <tchar.h> #include <iostream> #include <windows.h> using std::cout...
Hi, how can i access to the socket, that is used by web browser. Or how can i get data transfered between web browser and web server. I need to connect to that socket and modify the data, the web browser sends and recieves. What concrete functions should i use? I studiend the msdn documentation about this, but didnt noticed how do i get...
How can I interrupt sleep() using a signal handler? ...
template<typename T> void traverse_binary_tree(BinaryTreeNode<T>* root,int order = 0)// 0:pre, 1:in , 2:post { if( root == NULL ) return; if(order == 0) cout << root->data << " "; traverse_binary_tree(root->left,order); if(order == 1) cout << root->data << " "; traverse_binary_tree(root->right,order); if(orde...
Hi, I am using Qt 4.5 and having Qt Creator as the IDE. I am quite comfortable with it. I know we can open the .pro files (from the Qt Creator) in the Visual Studio IDE. But how about the reverse? i.e How can I open a visual studio Qt solution (.sln) in Qt Creator? Is it possible or I have to create a pro file again for the project? T...
Hello, Essentially, the situation is as follows: I have a class template (using one template parameter length of type int) and want to introduce a static array. This array should be of length length and contain the elements 1 to length. The code looks as follows up to now: template<int length> class myClass{ static int array[leng...
What does sig in int pthread_kill(pthread_t thread, int sig) refer to? Are there predefined sigs? :S ...
I have a the following code: #include <iostream> using namespace std; void func(char * aString) { char * tmpStr= new char[100]; cin.getline(tmpStr,100); delete [] aString; aString = tmpStr; } int main() { char * str= new char[100]; cin.getline(str,100); cout<< str <<endl; func(str); cout<< str <<end...