|
I would develop the user interface in C# and try to put the logic in VC++ if at all it is a mandate.
You talk about Being HUMAN. I have it in my name
AnsHUMAN
|
|
|
|
|
What is your goal?
For cross platform, Qt is probably the most dominant library.
For just Windows, .NET is the most dominant, though the actual UI jumps around (forms, XAML, Silverlight, etc.)
I personally love C++ and MFC and write small apps in both because I'm an expert in both (and will hopefully retire soon with that being my legacy of expertise.) However, if you are starting out, unless you are specifically interested in embedded systems, driver or kernel level code, C++ is a poor choice. Based on my recent interview experiences, Java probably has more demand than any language (Android is a big part of this) with C#/.NET web services being a close second. I have found increased interest in Qt, though I'm not convinced the demand will last much more than another decade, if that.
(On the flip side, iPhone apps are written in Objective-C. How long will that last? Who knows?)
|
|
|
|
|
I have given up on integrating MFC with VFW and embarking on usage of DirectX to collect data from USB video cameras.
I have found other sample code ( using MFC and VFW) and it behaves exactly the same way as my attempt to make it work.
I suspect that the issue is with my current ( and latest XP ) driver.
Besides getting used to confusing terminology – DirectX, DirectShow I have run into my first problem while using the sample code posted elsewhere here.
There seems to be MS specific and also VS release specific header sal.h ( or later sal2.h).
I have downloaded latest Windows SDK and this file is not there.
The “problem“ I am facing is that the file / header is defined in several VS versions, but than it also depended on other headers, as usual.
<b>I guess my silly question is – can these language additions , such as sal.h, by MS be downloaded individually from reputable source and not as a part of say VS 2010? </b>
The MS description lacks the “download from here” options.
As “painful” as it is I have no issue with creating my own headers dependencies.
Any reasonable advise will be as always appreciated.
Cheers Vaclav
|
|
|
|
|
On my system with Visual Studio 2010 Express I found it in C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include. A quick search with Windows Explorer should do it for you.
Use the best guess
|
|
|
|
|
Thanks Richard,
I am currently dowloading VS2010.
Vaclav
|
|
|
|
|
As a side note, I would just say that you are making the right decision. VFW is a dead end these days and DirectShow is a better option. Microsoft Media Foundation[^] is actually the next generation, replacing DirectShow. It requires Windows Vista or newer, so if you have requirements that includes using Windows XP, don't go down that route yet .
Soren Madsen
"When you don't know what you're doing it's best to do it quickly" - Jase #DuckDynasty
|
|
|
|
|
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
|
|
|
|
|
Yes i also get this., S_OK is zero.
But If I'm removing this then pstream is having some value.
Is there any problem with CreateStreamOnHGlobal()?
and one more thing,, as I got I can't draw anything outside paint event
if I'm limited to GDI+.
|
|
|
|
|
It seems this is not an easy fix, so let me ask you a couple of things.
- Do you have to use the Image and Graphics stuff?
- What is the format of your images (BMP, JPG, etc.)?
- Are you going to be drawing anything on top of your image?
Soren Madsen
"When you don't know what you're doing it's best to do it quickly" - Jase #DuckDynasty
|
|
|
|
|
-I'll have to recv some data on winsock socket and then display that on screen.
I'm using Image and Graphics it for ease.
-Its BMP
-No nothing on top of my image.
-> I'll have to recv the bytes and display image data on screen without saving it first.
|
|
|
|
|
Good, I figured it was something like this - there are so many classes and tools that need to load the images from file in order to display them, but you have to search hard to find some that will let you load an image already in memory.
Take a look at this article: Simple class for drawing pictures (JPG, TIFF, GIF, etc...)[^]
Examine the code to figure out what is wrong with your code or just use the class in your project. I know it is old and there might be newer stuff out there, but I have used the class to perform similar tasks. I have a project where I am using a button class derived from this class and it makes it possible to display just about any image on the buttons.
It has been so long since I looked at the code, that I did not remember it uses a similar approach as you did with the IStream object, so I am sorry I brought that into question.
Soren Madsen
"When you don't know what you're doing it's best to do it quickly" - Jase #DuckDynasty
|
|
|
|
|
|
Ahhh, I see. Sorry if I stepped on your toes, I should have checked for something like that.
Soren Madsen
"When you don't know what you're doing it's best to do it quickly" - Jase #DuckDynasty
|
|
|
|
|
SoMad wrote: Sorry if I stepped on your toes You didn't; I just thought some background detail may be useful.
Use the best guess
|
|
|
|
|
You also posted this question at Display image from stream[^]. Please do not post the same question in multiple forums.
Use the best guess
|
|
|
|
|
Yeah Sorry for posting at two places.
But the code that was to be implemented is not returning an image, as I implemented that in my code.
So I just wrote it as a new question instead revising the old one.
Thanks!
|
|
|
|