C / C++ / MFC
|
|
 |

|
Soren, thanks for the note. I have been hearing this “dead VFW” since I first started asking about it. My “standard” reply - “popular” OpenCV is based on VFW! The “problem” is that people are just cutting and pasting all of the VFW sample codes (posted here and elsewhere) and NOBODY really knows how it works as a real event driven Windows API! You can always find a”timer” or infinite “loop” somewhere in these samples – including in OpenCV basic code sample. As soon as I get this “sal.h” in, I am off and running! PS My last name is Sal! Cheers Vaclav PS How may developers are "building " for Vista? or ME? I'll wait for Windows 10.
|
|
|
|

|
Hi
I'm at my wit's end trying to access a user's Google contacts from my Visual Studio 2008 C++ desktop application. It's all set up with Google and I can run a php script online using Curl to get exactly what I need. So I thought I'd access that web page from my program using CInternetSession but then I can't get the redirected page after it's authorised. Then I thought I'd try intalling curl to use with VS but that's a nightmare. I might be able to use c# functions but I haven't learnt that yet, and am not sure how I can mix that with C++ (I think it can be done but my overall understanding of programming would make it very hard). Can anyone suggest what my best route would be?
Many thanks for your time
Greg Chapman
|
|
|
|

|
Hi,
I am working on a project in which I have created a property sheet, I am using 3 property pages in that. Now it happens that it perfectly displays in Windows xp (72 DPI default ), but if I run it on higher DPI than 72 DPI, controls starts disturbing. Many of the controls will hide.
I have one list control and 3 buttons on that which I have created manually (Hard-coded), not created on any dialog. I am facing big problem in setting the position of that List Control and 3 buttons.
Please let me know if anyone have any suggestions about this.
Any help will be appreciated.
Regards,
Mbatra
|
|
|
|

|
Unfortunately the only answer is to create your own layout manager, that checks the dimensions and DPI of the screen on start up, and adjusts each control to fit.
Use the best guess
|
|
|
|

|
I'm trying to display an image from a stream data.
But there is no image when getting image::from stream.
It's my source code:
IStream* pstream = NULL;
if(SUCCEEDED(CreateStreamOnHGlobal(NULL, TRUE, &pstream)))
{
ULONG lreal = 0;
pstream->Write(chIncomingDataBuffer, iEnd, &lreal );
if(pstream!= NULL)
{
MessageBox(hWnd,
" Stream is OK",
"Connection strt",
MB_ICONINFORMATION|MB_OK);
}
Image* image =Image::FromStream(pstream);
if(image)
{
RECT rect;
::GetWindowRect(hWnd, &rect);
Graphics graphics(hWnd);
graphics.DrawImage(image, 0, 0, rect.right-rect.left, rect.bottom-rect.top);
}
else
{
MessageBox(hWnd,
"No image is written",
"Connection strt",
MB_ICONINFORMATION|MB_OK);
}
if(image)
delete image;
image = NULL;
if(pstream)
pstream->Release();
pstream = NULL;
}
There is no image from data. Can anyone help me in this?
Thanks!
|
|
|
|

|
I have never tried doing it this way, but it looks like you took the sample from here[^], removed some stuff to make it simpler and changed it to write directly to your generic IStream object. I am not sure I like the whole thing, but it is kind of an interesting approach - if it works.
You do not show how you acquire the data that is stored in chIncomingDataBuffer. Are you sure this buffer contains an entire image?
I don't know if it is going to work, but right after you write the data to your pstream, its internal position will be pointing to the end of the data you just wrote. Try calling Seek() in order to change it to point to the start of the data.
Soren Madsen
"When you don't know what you're doing it's best to do it quickly" - Jase #DuckDynasty
|
|
|
|

|
I checked for an image of a particular data bytes then read it and wrote the code like this..
int iff2 = 2970;
iBufferLength = iSpaceRemaining = sizeof(chIncomingDataBuffer);
iEnd = 0;
iSpaceRemaining -= iEnd;
iBytesRead = recv(Socket, chIncomingDataBuffer+iEnd, iSpaceRemaining, 0);
iEnd+=iBytesRead;
if(iEnd ==iff2)
{
MessageBox(hWnd,
"Image is written ok",
"Connection strt",
MB_ICONINFORMATION|MB_OK);
IStream* pstream = NULL;
In starting if I'm trying to write an image using fwrite then its ok with exact bytes data.
But on stream, its showing some data in stream but not loading any image.
|
|
|
|

|
Ok. Let me know what happens when you call Seek() on pstream after writing the data.
Soren Madsen
"When you don't know what you're doing it's best to do it quickly" - Jase #DuckDynasty
|
|
|
|

|
I added code for Seek() method but problem is same.
ULONG lreal = 0;
LARGE_INTEGER liBegining = { 0 };
if(S_OK && pstream)
{
pstream->Write(chIncomingDataBuffer, iEnd, &lreal );
pstream->Seek(liBegining, STREAM_SEEK_SET, NULL);
this is the added code.
But there is nothing.
|
|
|
|

|
Wait a second. I see that you changed the code. You have a bug in if(S_OK && pstream). The value of S_OK is zero, so in the code above you are not not going to do the Write() and the Seek().
Soren Madsen
"When you don't know what you're doing it's best to do it quickly" - Jase #DuckDynasty
|
|
|
|
 |
|
|
General
News
Suggestion
Question
Bug
Answer
Joke
Rant
Admin