|
I have a app using ATL for both the COM and the Service pieces. I have recently had need to bring in some old code that archives itself via CArchive (MFC). I don't seem to be able to hack up the right choices/orders of headers for getting the ATL classes like CAtlServiceModuleT while still have the MFC class CArchive available.
The only docs I've found so far, deal with including the MFC bits first, then the ATL bits. But that defines _AFX, and so the ATL bits leave out items like CAtlServiceModuleT.
Is there some way to make ATL the "main" library and then pull in the MFC bits later? Short of #undef'ing too many things and/or pulling bits out of header files, etc.
Thanks,
CraigL
|
|
|
|
|
Hi,
I have downloaded OpenCV 2.2.0 distribution for visual studio 2010 and as i started programming with the opencv APIs under VS 2010 I faced a terrible problem.
cvSobel and cvLaplace functions always throw cv::Exceptions and also their exceptions could have not been handled with try ... catch blocks.
the provided error is: Unhandled exception at 0x7463b727 in App.exe: Microsoft C++ exception: cv::Exception at memory location 0x003bfb9c.
and here is my code:
IplImage* pImage = cvLoadImage("..\\Tulips.jpg");
IplImage* pImage1 = cvCreateImage(
cvSize(pImage->width, pImage->height),
pImage->depth,
pImage->nChannels
);
IplImage* pImage2 = cvCreateImage(
cvSize(pImage->width, pImage->height),
pImage->depth,
pImage->nChannels
);
cvSobel(pImage, pImage1, 0, 1, 2);
cvLaplace( pImage, pImage2);
cvNamedWindow("Image", CV_WINDOW_AUTOSIZE);
cvShowImage("Image", pImage);
cvNamedWindow("Image1", CV_WINDOW_AUTOSIZE);
cvShowImage("Image1", pImage1);
cvNamedWindow("Image2", CV_WINDOW_AUTOSIZE);
cvShowImage("Image2", pImage2);
cvWaitKey(0);
please, help me if I am forgetting sth.
|
|
|
|
|
You cannot use any type of images with a sobel operator. If you use a 8U image as the source then the destination image needs to be 16S (not even 16U) because of some overflow issue then you can transform if back to 8U at will.
|
|
|
|
|
Hi,
How can I display html text on a windows form using ATL/WTL in C++? I want to mimic Microsoft Office tooltips in my C++ windows app.
Thanks!
|
|
|
|
|
web browser activex control is the first option for html.
|
|
|
|
|
Thanks for replying, but I am working with a Windows Form using ATL/WTL.
|
|
|
|
|
it is an activex control, you can definitely use it with all micosoft programing technologies.
|
|
|
|
|
Hi I m trying to load the dll using LoadLibrary which works fine.
But for one of the method paramter is an object of class which is refered inside the dll . So in this case in my client app how do i refer the .h file which is already refered in the dll inside ?
As i m trying to link dynamically how does header file references are dealt with ?
Thanks
|
|
|
|
|
DavJes wrote: So in this case in my client app how do i refer the .h file
The same way as any header file is referenced; either add it to your project or add the location to the list of include directories.
If you are saying that you do not have access to the header file, then you have a problem.
I must get a clever new signature for 2011.
|
|
|
|
|
What would be an easy way to encrypt/decrypt userID/password data coming in from potential remote user to a secure server? Phase 2 might include encrypting the subsequent data flow as well.
Any ideas would be appreciated.
Thanks
|
|
|
|
|
|
Thanks. I'll check that out.
|
|
|
|
|
|
hi friends,
i have have a MDI Application. when i close a document using onclosedocument. my document handle remains active though the members used in document are set to null. so i cannot check this condition
if(doc)
as it returns true. whereas in the if block it cannot access the members so app crashes
eg.
<pre>
if(doc) //handle =FAEX000
{
doc->getprivatevariable_or_functions(); // the application crashes here
}
</pre>
thanking in anticipation
REgards
Samir
|
|
|
|
|
When you close your document set the variable to NULL to indicate that it no longer exists.
I must get a clever new signature for 2011.
|
|
|
|
|
OK, the really hot chicks part was just a joke.
Seriously, I have an ATL COM server that runs as a service. The ATL server is run as a singleton (REGCLS_MULTIPLEUSE). I've got a series of "client" apps (on the same machine) that send the server some data. When the server is shutdown, I want to send an event to the clients. Since I'm using COM I figured I'd use connection points. The server does this with ATL's IConnectionPointContainerImpl, and their proxy class wrapper around the dispatch event interface. I can see that the client properly registers with the server. But when the server tries to call back the client interface, it get's an error, and the client gets an access violation.
Is there some obvious step I've missed? On the client side I'm using ATL's IDispEventImpl to implement the dispatch interface callback.
|
|
|
|
|
Add Your code and error description, please
|
|
|
|
|
Hi,
I'm slowly getting into GUI Development and made first experiences with C++/Qt4 which I really like.
I focus on OSX Development so I decided to give a try to Xcode and Cocoa too. I tried the first tutorial where u build a simple currency converter. And I'm finding this very confusing. Am I really forced into using this Interface Builder App?
I think that GUI Development with Qt is much better to learn and faster to code and I have a much better overview over my Interface and all those signals, slots, senders and so on if I don't have to use those object inspectors just to check what object is connected to what...
What do you think? Should I give XCode another try or do you share my first impression?
|
|
|
|
|
I was using XCode to do iPhone development and found it to be a challenge as well. What I did is to change to use MonoTouch (.NET) for iPhone development. There actually is a version of Mono that works pretty well on the Mac if you are a .NET programmer. Knowing Obj-C is not a bad thing, but it is not that fast when you are used to other things.
Other people have done their Mac apps with Air or Java. I know Qt is definately faster for most people starting out than Obj-C is. So if you do not want to use Air, Java, or Mono, then I would say Qt will be faster, but having the knowledge of Obj-C is good as well since alot of the sample code out there for a Mac is written in Obj-C.
Steve Maier
|
|
|
|
|
Hi guys, am in a MFC project for that i need to notify my client when any data is updated or inserted in my server database.
I am using CSocket for server client connections, how can i identify the change and how to notify my client that's my problem.I am beginner in MFC .
If you know pls guide me .
Thanks in advance
ganesh_IT
|
|
|
|
|
What's the lightest and easiest way to pass a message from on thread to another? The sender thread must be able to do this asynchronously so there's no to minimal time delay. The receiving thread will retrieve the thread and write it to a file. The goal here is to concentrate the hiccups associated with disk i/o to the one logging thread, so that the other working threads are not hiccup prone. It's okay that the logging thread is hiccup prone since that is all it's responsible for.
Thanks for any help with this.
|
|
|
|
|
Say you have a structure like so, accessible by both threads as a global variable:
typedef struct {
void *data;
void *next_block;
}block;
The idea is to have a list of data blocks, each with a pointer to the data to be written to file, and a pointer to the next data block to be written.
The sender thread will do its work, and every time data has been generated, it will allocate a new block and add its address to the next_block member of the previously last block. The next_block member of the newly added block is set to null.
The receiver/writer thread will start at the beginning of the array and continuously check if next_block has been changed from a null-pointer to something else. When it's no longer null, the sender thread must have added data. This new data is written to file and may be free'd in memory. The block struct which data was written before this block's data may also be free'd now.
After this, the check loop on next_block will continue, based on the last written block.
modified 13-Sep-18 21:01pm.
|
|
|
|
|
Thanks, I like this solution. Additionally I'd need to manage shared access with mutexes.
|
|
|
|
|
That shouldn't even be necesary in this case:
If you make sure a block is initialised (data pointer valid, next_block pointer initialised) before it's appended to the list by the sender thread, it can't cause multithreading problems since the actual appending action is just one assignment.
modified 13-Sep-18 21:01pm.
|
|
|
|
|
It has been awhile since I've looked this deeply into things. Is the following a good way to convert from a wstring to a string?
std::string dwl::convertWstrToStdString(const std::wstring & wStr) {
const std::locale & loc = std::wcout.getloc();
std::string str;
str.resize(wStr.size());
std::string::iterator it = str.begin();
for (std::wstring::const_iterator wit = wStr.begin(); wit != wStr.end(); ++wit) {
*it = std::use_facet<std::ctype<wchar_t> >(loc).narrow(*wit);
++it;
}
return str;
}
Or is the 'str.resize' note (or something else) going to bite in the future? Will the str iterator correctly increment if the character it points to will be a Multi Byte character? Should I just use WideCharToMultiByte() and massage it into a std::string?
Thanks,
David
|
|
|
|