|
Or it's been deleted already...
|
|
|
|
|
In my function, Im assignning one Global CString to varaible declared in header file.But it shows unhandled exception error.
My code
CString sReceiceStr = _T("");
void CChatServerDlg::AddMsg( userinfo *udata, CString sIP)
{
sReceiceStr.Format("%s : %s : %s : %s : %s",udata->cSessionID ,udata->cTraineeName, udata->cPassword, udata->cClientServerMsg, udata->cInsName);
sTempassign = sReceiceStr;
It shows error in the above line. It shows error in CStringData GetData() function
Kindly help me.
Anu
|
|
|
|
|
Runtime exception or compile error?
You could try to use the _T macro for the format string - _T("%s : %s : %s : %s : %s")
|
|
|
|
|
Run Time error only.
But when i cahnge the calling method og AddMsg,no error is coming.
May be it smy mistake.Now its working.
Anu
|
|
|
|
|
have you check the string formation of variable after string.format ? try using watch
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Is udata non-NULL ? Have you stepped into Format() to see what throws the exception?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
cann't ?
the method?
just like xaml in wp7
|
|
|
|
|
XAML is XML.
If you want to do it without using XAML and WPF, then you will need to write a lot of code to translate XML contents into UI elements.
My advice is not to try it because it will become overwhelming.
|
|
|
|
|
though i am agree with superman, however it is possible to make dialog box using xml, for that you have write your own custom class to read, handle and create the dialog box, its a complicated task however doable.
Let me know if you are interested, i can provide you some starting point
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Additionally to what the others said, depending on your actual needs (of which you didn't say much about), you could try writing a converter that can process an XML and generate a resource file (.rc) that can be processed by the resource compiler tool of VS to generate the dialog resource.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> If it doesn't matter, it's antimatter.<
|
|
|
|
|
And yet another addition to the answers above - some 3rd party cross platform windowing libraries use XML for describing their controls and layouts.
wxwidgets[^] has a working XML layout manager which is only minorly painful to use.
Cheers,
Ash
|
|
|
|
|
I'm doing massive testing on the program that I have been writing. This round of test is on fresh OS installations, to see if I'm missing anything.
I made a straight Win32 c++ project, and thought I was c++ redistribution file free. On my first Windows 7 test, the program said the MSVCR100.dll is missing. So I went back to the setup and deployment and added it.
Do I really need that file? I looked in the project and could not find any reference for it. Just curious.
|
|
|
|
|
You can find the reference to this in Project -> Properties -> Configuration Properties -> C/C++ -> Code Generation -> Runtime Library .
|
|
|
|
|
|
In Cont, to replies above:
Project -> Properties -> Configuration Properties -> C/C++ -> Code Generation -> Runtime Library
Make it plain "MultiThreaded(/MT)". it removes the MSVC dll dependency.
/MT Means sTaTic link
/MD means Dynamic link
|
|
|
|
|
Have a 5 'cause I can just imagine some meeting at Microsoft where they decided to use /MT for that reason.
Made me laugh anyway, even if it wasn't intentional.
|
|
|
|
|
I'll make the change today, after the Windows 7 test run.
Cool, that's for the tip guys.
|
|
|
|
|
Hi Everybody, I want to change the color of selecting text in an edit control and I ran out of ideas.
I am totally confused, please anyone guide.
It is a WIN32 C++ Application.
Regards,
Vishal
|
|
|
|
|
That's a Windows setting. You can change it via code, but that may end up irritating the user. In any case, see SetSysColors() and COLOR_HIGHLIGHT .
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
SetSysColors() works, but it had changed the default COLOR_HIGHLIGHT color to BLACK,
I had used RGB(0,0,0)
This function changes the global highlight color, I want to change highlight color of my edit control only.
How to achieve this.
Regards,
Vishal
|
|
|
|
|
vishalgpt wrote: I want to change highlight color of my edit control only. How to achieve this.
Custom control.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Hi, I was guessing the same, but i am creating a win32 application,
1) Sould i go with MFC
2) Or Subclass existing edit control in win32 c++
Or some other way if exists:...
Regards,
Vishal
|
|
|
|
|
SOLVED
Adding MJPEG driver to my box solved the problem.
Now I need to clean up the test mess I have added to my app!
Moral of the story - when working with OpenCV beware of lack of commnets in the code and always check the logic, it is not the best. I actually feel this is a (logical ) bug and has been in OpenCV since 1.1 and it is still in 2.4.0.
Thanks for all your help.
vaclav
I am trying to display image from USB connected camera.
I know the camera works – I can get a nice image using MS Scanner and Camera wizard.
My problem is that capGetVideoFormat fills the BITMAPINFO biCompression with a value I have no idea what it represents. MSDN is no help in defining this in video frame.
If it is a decompressor info it does not match any of 15 decompression installed on the system.
So
<b>how do I KNOW for sure the USB video is compressed and
how do I use this biCompression value for further processing?</b>
Here is the offending snippet from OpenCV library
BITMAPINFO vfmt;
memset( &vfmt, 0, sizeof(vfmt));
BITMAPINFOHEADER& vfmt0 = vfmt.bmiHeader; // input header
int sz, prevWidth, prevHeight;
if( !capWnd )
return 0;
this fills the biCompression value in question
sz = capGetVideoFormat( capWnd, &vfmt, sizeof(vfmt));
…..............
And this is where attempt to locate the decompressor driver fails
hic = ICLocate (ICTYPE_VIDEO, 0L, (LPBITMAPINFOHEADER) &vfmt,
NULL, ICMODE_DECOMPRESS);
Any suggestions are as always appreciated.
PS I need to stay with capAVI and OpenCV.
Thanks
Vaclav
|
|
|
|
|
Vaclav_Sal wrote: My problem is that capGetVideoFormat fills the BITMAPINFO biCompression with a value I have no idea what it represents.
What is its value?
Veni, vidi, vici.
|
|
|
|
|