How can I get the same IP Address I get when I go to "http://www.whatsmyip.org/" using C++ and winsock library?
I know how to get the "127.0.0.1" and the router IP "192.168.1.103"...
But when I got to "http://www.whatsmyip.org/" I get "65.55.105.132"...
How can I accomplish this?
...
Alright, I'm injecting some code into another process using the CreateRemoteThread/LoadLibrary "trick".
I end up with a thread id, and a process with a DLL of my choice spinning up. At least in theory, the DLL does nothing at the moment so verifying this is a little tricky. For the time being I'm willing to accept it on faith alone. ...
I have just started to develop in QlikView so I'm completely a newbie.
The problem that I have is that I need to create a c++ dll that can be used as a custom data source for QlikView, I already created the dll and QlikView can see it, but I don't know how should I do to make my data available to QlikView.
The data that I want to use i...
I'm working on getting some legacy code under unit tests and sometimes the only way to sense an existing program behavior is from the console output.
I see lots of examples online for how to redirect stdout to another file in C++, but is there a way I can redirect it to an in-memory stream so my tests don't have to rely on the disk?
I'...
Hi all,
I have a Visual Studio 2008 solution comprised of several projects. Only some header files in each project represents API to the library built from the project.
Is there a way in Visual Studio to copy the files to a common directory prior compilation?
(I want to do it in order prevent including unintentionally header file I'm n...
I have a small question about structures with the LayoutKind.Explicit attribute set. I declared the struct as you can see, with a fieldTotal with 64 bits, being fieldFirst the first 32 bytes and fieldSecond the last 32 bytes. After setting both fieldfirst and fieldSecond to Int32.MaxValue, I'd expect fieldTotal to be Int64.MaxValue, whic...
I find myself constantly running into a situation where I have a set of messages that I need to send over a TCP/IP connection. I have never found a good solution for the design of the message class. I would like to have a message base class where all messages derive from it. Since each message will have different fields, this would allow...
Is it possible to access values of non-type template parameters in specialized template class?
If I have template class with specialization:
template <int major, int minor> struct A {
void f() { cout << major << endl; }
}
template <> struct A<4,0> {
void f() { cout << ??? << endl; }
}
I know it the above ca...
I would like to grab the entire tree for a Writer document in OpenOffice 3.1. I need to collect data on all the elements in the tree, not only the Text elements.
By loading the XTextDocument and doing getText() will give the XText element. More specifically, using an XEnumerationAccess from the XText will only iterate over the TextRange...
I'm working on some code that is normalizing a lot of data. At the end of processing, a number of key="value" pairs is written out to a file.
The "value" part could be anything, so at the point of output the values must have any embedded quotes escaped as \".
Right now, I'm using the following:
outstream << boost::regex_replace(src, ...
It's kind of confusing when it comes to Microsoft Visual C++.
How to tell whether a Microsoft Visual C++ project is a .Net project, or a native C++ project?
...
Hello,
I'm learning C++ and i want to know how i can print the IP adress of the host machine, but remember that my program is a command line aplication(cmd), but i don't want the code, but some links here i can learn this, not copy and paste. Thanks!
...
I have compilation errors while compiling MySQL sample of storage engine from MySQL 5.1.36 sources. Looks to me that I set all paths to include subdirectories but that seems not enough.
Here are the errors:
1>c:\users\roman\desktop\mysql-5.1.36\sql\field.h(1455) : error C2065: 'FRM_VER' : undeclared identifier
1>c:\users\roman\...
Given a managed COM object and an associated tlb file, I would like to access it from some unmanaged C++ code WITHOUT using the TLB/import command. But use a header file.
Is there a way to extract a header file from a TLB?
Thanks
...
So I have starting to learn Qt 4.5 and found the Signal/Slot mechanism to be of help. However, now I find myself to be considering two types of architecture.
This is the one I would use
class IDataBlock
{
public:
virtual void updateBlock(std::string& someData) = 0;
}
class Updater
{
private:
void updateData(IDataBlock &...
Hi,
I'd have to say I'm no expert on using the STL. Here's my problem, I have a class Called LdapClientManager which maintains a number of LDAP clients that are managed by ID. The container holding the LdapClients is declared as a member variable i.e.
typedef std::map<int, LdapClient *> LdapClientMap;
LdapClientMap _ldapClientMap;
T...
I have created a COM componenet named as Test.dll in that i have created an interface IDiscover.
Now i came to 2 ways of allocating the memory as
IDiscoverPtr id(__uuid(TestClass)); and Test::IDiscover *id=NULL;
What is the differnce between these two....Any Information is appreciated..
Thanks in Advance
...
I am writting code in c++, gdi+.
I make use of Image's GetThumbnail() method to get thumbnail.
However, I need to convert it into HBITMAP.
I know the following code can get GetHBITMAP:
Bitmap* img;
HBITMAP temp;
Color color;
img->GetHBITMAP(color, &temp); // if img is Bitmap* this works well。
But how can I convert Image* into Bitm...
Hi what's wrong with my code I am trying to register the class in registry in the following way but while I am debugging it shows that class is not registered and application crashes.
What is wrong in this code please Help me.
Test::IDiscover *pICalc = NULL;
HRESULT hRes=CoCreateInstance(Test::CLSID_SqlClass, NULL,
CLSCTX_INPROC_SER...
Can anyone explain me, the concept of covariance and contravariance in
programming languages theory?
...