|
See, for instance, [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hello there.
I have a third party libraries that is expected to deliver back parameters encoded as wide char strings.
so in my client application I just intercept and expolit their values :
void onDataFromDLL(std::wstring myStr){
//
}
my client app is MFC dlg with unicode defintion.
is there a way from there to tell that myStr content is actually wide char encoded ??
The reason is becuase of many weird results I get.
Thank you in advance.
"The Awaited Saviour", Mohammed Baqir Al Sadr
|
|
|
|
|
hINTModuleState wrote: is there a way from there to tell that myStr content is actually wide char encoded ??
The reason is becuase of many weird results I get.
Usually 'the weird results' test's failure provides an hint.
BTW how do you call such library (what is the API exposed)?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
The API exposed is in form of export classes with virtual handlers to be overriden.
In fact I am trying to integrate a SAX parser (from Poco C++ project).
The parser has a contenthandler with virtual methods that send back the xml tags and properties encountered.
The library can be compiled in two different ways, either by defining a certain _xxx_UNICODE symbol or not. The consequence is on the definition of a certain library exported type : XMLString (either an std::string or an std::wstring accordingly).
The parameters I collect and try to exploit in the virtual methods of the derived classes are mostly of type XMLString.
for instance :
void startElement(const XMLNode & localName..); is a virtual methods that is called each time tghe parser encounters a new XML tag.
if Poco's XML library is compiled without the _xxx_UNICODE symbol then there is no problem trying to play with the received parameters and comparing them against std::string variables content,etc
in the
The problem is when the library is compiled as unicode and that I am expected to receive the parameters content as wide chars. :
displaying the content of an XMLString (=std::wstring) in a TRACE or AfxMessageBox, or evebn trying to compare it against a value that is supposed to equal it always fails..
"The Awaited Saviour", Mohammed Baqir Al Sadr
|
|
|
|
|
How do you display the string content (i.e. are you doing a UNICODE build of your application)?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
This is how supposing localName is of type XMLString (ie std::wstring) which I want to display :
CString str;
str.Format(_T("%s"),localName.c_str());
AfxMessageBox(str);
(or even AfxMessageBox(localName.c_str()); )
my application is Unicode so the %s will cause the paramter localName in ::Format to be interpreted as widechars.
neverthless I get unregnizable things in screen.
Neverthless I now discover that when I put %S then I can understand what is displayed.
Since %S in context of Unicode app means to interprete the param as simple chars then my conclusion
is that the third party library is no doing anything like actually formatting results in wide chars.
I'm not sure of my conclusion..but the following is taken from MSDN regarding the printf :
[
S
String
When used with printf functions, specifies a wide-character string; when used with wprintf functions, specifies a single-byte–character string. Characters are printed up to the first null character or until the precision value is reached.
]
Anyway..well Poco..well..
"The Awaited Saviour", Mohammed Baqir Al Sadr
|
|
|
|
|
Hello all.. I don't know how to achieve this but i guess that's possible..
I've one dialog box and a picture control on it. I'm using CxImage Class to load and display PNG on that picture box.. Till now everything is good.. Now i've to show that PNG in a way so that it look like it's drawn on desktop screen. So for that i make my dialog transparent.. But making dialog transparent makes my picture control transparent. So no PNG is being shown. How do i overcome this problem...Or is there any way in CxImage Class to show PNG directly on desktop screen by taking DC of desktop screen..
Here is code to make dialog transparent..
SetWindowLong(hWnd,GWL_EXSTYLE,GetWindowLong(hWnd,GWL_EXSTYLE)^WS_EX_LAYERED);
SetLayeredWindowAttributes(hWnd,RGB(0,0,0),0,LWA_ALPHA);
Thanks all...
|
|
|
|
|
Look into "UpdateLayeredWindow" if you want to use per-pixel blending.
AtomAnt
|
|
|
|
|
I think I told you yesterday did you see GetDesktopWindow?
|
|
|
|
|
Yes i did.. And that'll be great if i show my PNG on desktop rather than dialog box.. I did something like this..
BeginPaint (hWnd, &ps) ;
HWND hDesktop = GetDesktopWindow();
HDC hdc = GetDC(hDesktop);
CxImage image("E:\\My_Prog\\FINAL_PNG\\Res\\Test.png", CXIMAGE_FORMAT_PNG);
BOOL iReturn = image.Draw(hdc, 50, 50);
EndPaint (hWnd, &ps) ;
I get the handle of desktop and DC also.. But it didn't draw the PNG. What am i doing wrong?
|
|
|
|
|
Its working for me of course like this:
HWND hDesktop = ::GetDesktopWindow();
HDC hdc = ::GetDC(hDesktop);
CImage image;
image.Load("f:\\1.png");
BOOL iReturn = image.BitBlt(hdc, 50, 50);
|
|
|
|
|
Ok so you're using BitBlt.. But when i use image.BilBlt it says.
"error C2039: 'BitBlt' : is not a member of 'CxImage'"
Obviously there's no member called BitBlt in CxImage Class.. So do i need to use CImage??? Does BitBlt comes under Cimage??? Or can i use BitBlt on CxImage??
|
|
|
|
|
Yeah because I use of CImage class not CXImage article.
|
|
|
|
|
Alright.. Anyways i manage to Draw the PNG on desktop screen.. But the problem is that it get erases whenever any window is dragged on it.. Is there any way to refresh it???
|
|
|
|
|
Hello I am new to c++. Can you help me in this program.
The program is- Use binary search technique to search a user given name from an array of 10 pre-defined names. Use of array is a must. The names in the array are already sorted alphabetically.
Thanking you in advance........................................bishshoy007
|
|
|
|
|
Please don't shout.
It looks like a (simple) homework assignment (we won't do it for you, but we may help). What have you done so far? What is your trouble about?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
You did not get the response you were hoping for here so you asked the very same, unedited question on a different forum. Amazing.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hi all
I am getting an error message in my application "This application has failed to start because cximagecrtd.dll was not found".
I tried to download the cximagecrt.dll/cximagecrtd.dll from net. But i couldn't able to find anywhere. Can some one please provide this for me.
Thanks in advance.
Regards,
balaram
|
|
|
|
|
You get the source and the project file when you download CxImage.
Just build the CxImageCrtDll project that's inside the CxImageLib workspace.
|
|
|
|
|
May I ask a question why you need to use of CXImage?
|
|
|
|
|
My question is when did this become a CXImage support site?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Did you see some posts of people they want to use of CXImage for load and show jpg,gif files while they have other ways.
|
|
|
|
|
Hi
I am facing problem in accessing the function template written inside a class. My code is as follows.
Please help me in this regard.
mytemp.h
class mytemp
{
public:
mytemp(void);
~mytemp(void);
template<typename t="">
static T templateadd(T x, T y);
};
mytemp.cpp
template <typename t="">
T mytemp::templateadd(T x, T y) {
return (x + y);
}
main.cpp
int _tmain(int argc, _TCHAR* argv[])
{
cout<<mytemp::templateadd(10,2); // Here I am getting error: unresolved external symbol ...
//Here I want to access templatedadd() of mytemp class. Please tell me What should be the statement.
return 0;
}
|
|
|
|
|
This is a subtle problem with templates, there's an explanation ahy it happens in here[^]
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|