|
|
I'm new to Windows programming but have some C++ experience. I need to create an application to display some data I'm receiving from another application via shared memory.
All I want is a display window with a slider so I can change the view of what data is in view.
I've looked around this site but haven't found a project that seems close. What I'll be displaying is a text lable followed by a variable of one of a couple of types (floating point, text, or integer).
JAM
|
|
|
|
|
|
Hey I Got your point!.
Ok,
Consider that u want to share a file with other program at the real time. Both Application should have all privilages than.
You can directly read contents of file by using CFile class and manipulate contents of the file which will have effect on bith application. I have never tried this before. But I guessed that you want this.
Let me know your comments.
God Knows Better
|
|
|
|
|
We're not there yet. All I'm trying to do is figure out how to write a visual C++ app that will will display my real-time data. I already know how to get the data, what I'm finding difficult to do is display it in a scrollable window.
I thought of using a listbox, but what I really need is just a display window.
Any thoughts?
|
|
|
|
|
Yes This is very simple
1) Inherit CFrameWnd class
2) Override the OnPaint() function, here you will get CPaintDC dc device context. By using dc u can draw anything like any shapes rectangle, ploygon, etc and also you can write any Text.
3) Create the Your inherited class on the heep where ever you want to call this application.
Later call your class ->ShowWindow(SW_SHOWMAXIMIZED);
->UpdateWindow();
Let us take an example.
class CAzg:public CFrameWnd
{
afx_msg OnPaint();
}
CAzg::OnPaint()
{
CPaintDC dc(this);
dc.TextOut("God is Great");
}
Suppose you want to display this window when next button is pressed.
Call CAzg *a;
int the declaration of class where you want to call
---::OnNext()
{
a = new CAzg;
a->ShowWindow(SW_SHOW);
a->UpdateWindow();
}
thats it.
Try this !.
bbye
God Knows Better
|
|
|
|
|
I have a code written by the previous version of VC++. I meet the difficulty to build it using .net. The error message is:
LINK : fatal error LNK1181: cannot open input file 'C:\Program.obj'
I don't know what this means. Thank you in advance for your help.
Build Log ------- Build started: Project: ShowDx, Configuration: Debug|Win32 -------
Command Lines Creating temporary file "c:\Research\Dymore\ShowDx\Debug\RSP000022.rsp" with contents
[
/Od /I "Head" /I "..\pgrm\Head" /I "f:\platformSDK\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /FD /EHsc /RTC1 /MDd /Yc"stdafx.h" /Fp".\Debug/ShowDx.pch" /Fo".\Debug/" /Fd".\Debug/" /FR".\Debug/" /W3 /c /ZI
.\Head\StdAfx.cpp
]
Creating command line "cl.exe @c:\Research\Dymore\ShowDx\Debug\RSP000022.rsp /nologo"
Creating temporary file "c:\Research\Dymore\ShowDx\Debug\RSP000023.rsp" with contents
[
/Od /I "e:\mssdk\include" /I "Head" /I "..\pgrm\Head" /I "f:\platformSDK\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /FD /EHsc /RTC1 /MDd /Yu"stdafx.h" /Fp".\Debug/ShowDx.pch" /Fo".\Debug/" /Fd".\Debug/" /FR".\Debug/" /W3 /c /ZI
Creating command line "cl.exe @c:\Research\Dymore\ShowDx\Debug\RSP000023.rsp /nologo"
Creating temporary file "c:\Research\Dymore\ShowDx\Debug\RSP000024.rsp" with contents
[
/Od /I "Head" /I "..\pgrm\Head" /I "f:\platformSDK\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /FD /EHsc /RTC1 /MDd /Fp".\Debug/ShowDx.pch" /Fo".\Debug/" /Fd".\Debug/" /FR".\Debug/" /W3 /c /ZI
Creating command line "cl.exe @c:\Research\Dymore\ShowDx\Debug\RSP000024.rsp /nologo"
Creating temporary file "c:\Research\Dymore\ShowDx\Debug\RSP000025.rsp" with contents
[
/Od /I "e:\mssdk\include" /I "Head" /I "..\pgrm\Head" /I "f:\platformSDK\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /FD /EHsc /RTC1 /MDd /Fp".\Debug/ShowDx.pch" /Fo".\Debug/" /Fd".\Debug/" /FR".\Debug/" /W3 /c /ZI
]
Creating command line "cl.exe @c:\Research\Dymore\ShowDx\Debug\RSP000025.rsp /nologo"
Creating command line "rc.exe /d "_DEBUG" /d "_AFXDLL" /l 0x409 /I "Show" /I "e:\dymore\ShowDx\Head" /fo".\Debug/ShowDx.res" .\Show\ShowDx.rc"
Creating temporary file "c:\Research\Dymore\ShowDx\Debug\RSP000026.rsp" with contents
[
/OUT:".\Debug/ShowDx.exe" /INCREMENTAL:NO /NOLOGO /DEBUG /PDB:".\Debug/ShowDx.pdb" /SUBSYSTEM:WINDOWS /MACHINE:X86 C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Lib\ddraw.lib e:\mssdk\lib\dxguid.lib winmm.lib
Creating command line "link.exe @c:\Research\Dymore\ShowDx\Debug\RSP000026.rsp"
Output Window Compiling...
Generating Code...
Compiling resources...
Linking...
LINK : fatal error LNK1181: cannot open input file 'C:\Program.obj'
Results Build log was saved at "file://c:\Research\Dymore\ShowDx\Debug\BuildLog.htm"
ShowDx - 1 error(s), 0 warning(s)
|
|
|
|
|
Paintbrush wont open the image created by this code:out of memory for no apparent reason:
FILE* fp = fopen("E:\\ATrainerNew\\AS3Train\\STrain23d\\Pallett.bmp","rb");
fseek(fp,0,SEEK_SET);
fseek(fp,0,SEEK_END);
long sz = ftell(fp);
if (sz == -1L) return(1);
char* pImagePointer = new char[sz];;
fseek(fp,0,SEEK_SET);
int rtn = fread(pImagePointer,sz,1,fp);
fclose(fp);
if (rtn != 1) return(1);
PBITMAPINFO pBMInfo = (PBITMAPINFO)(pImagePointer + sizeof(PBITMAPFILEHEADER));
int numberOfRows = 32;
int numberOfColumns = 256;
pBMInfo->bmiHeader.biWidth = numberOfColumns;
pBMInfo->bmiHeader.biHeight = numberOfRows;
unsigned char* pPixel = (unsigned char*)(pBMInfo->bmiColors) + 1024;
int i,j;
for (i = 0 ; i < numberOfRows ; i++)
for (j = 0 ; j < numberOfColumns ; j++) *pPixel++ = j;
FILE* fpOut = fopen("e:\\rainbow.bmp","wb");
int nPixel = numberOfColumns * numberOfRows;
int size = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER) + 1024 + nPixel;;
fwrite(pImagePointer,size,1,fpOut);
fclose(fpOut);
return 0;
}
Thanks for the help,
ns
|
|
|
|
|
As I undertsood, your original Pallett.bmp has 256 colors pallete. Right?
If so, then cjeck what this stement means in your code:
unsigned char* pPixel = (unsigned char*)(pBMInfo->bmiColors) + 1024;
Looks weird to me!...
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
You makin' rainbows again? Smokin' the funny stuff, are we? I was informed by a somewhat shocked relative that it's Diwali. So happy Diwali.
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Ha ha!
Sorry for this late response --- I couldnt find the threads for a few days there.........
Happy Diwali! I'm terrible about this stuff too but my dear ole mom emails every day so I know these things now!!!
Yep --rainbows again. Basically we needed to add another palette and in the process I show a rainbow image in the status bar...it keeps adjusting to the slider that does the brightness and contast etc. Fun stuff.
Just finished the latest feature addition on saturday so now racking my brains for another useful thing to add....gotta keep busy.
|
|
|
|
|
I want to hide a tab from the property sheet based on the user's access role. Can this be done?
Elizabeth
|
|
|
|
|
CPropertySheet::RemovePage
CPropertySheet::AddPage
|
|
|
|
|
I'm trying to move values in an array downwards.
This is just example code and I can't make it working:
char** t = new char*[5];
void move();
void print_data();
int main()
{
char* e1 = "one";
char* e2 = "two";
char* e3 = "three";
char* e4 = "four";
char* e5 = "five";
t[0] = e1;
t[1] = e2;
t[2] = e3;
t[3] = e4;
t[4] = e5;
print_data();
std::cout << "------------------------\n";
move();
print_data();
delete [] t;
return 0;
}
void move()
{
for(int i = 5; i >= 0; i--)
{
char* temp = NULL;
if(i == 0)
temp = nada;
else
temp = t[i-1];
t[i] = temp;
}
t[0] = "new value at first position";
}
void print_data()
{
for(int i = 0; i < 5; i++)
std::cout << i+1 << " -> " << t[i] << "\n";
}
When the program tries to delete t it crashes with this debug info:
DAMAGE: after normal block (#bla bla) at 0xbla bla.
Well, I guess it's useless but how can I solve this?
And please, don't ask why I'm doing this
Rickard Andersson
Here is my card, contact me later!
UIN: 50302279
Sonork: 37318
|
|
|
|
|
Rickard Andersson18 wrote:
char** t = new char*[5];
this is a RUNTIME statement, defined static. i think this doesnt work!
put it in the main function!
Don't try it, just do it!
|
|
|
|
|
I've changed it, and tried it, it still gives me the same error as before.
Rickard Andersson
Here is my card, contact me later!
UIN: 50302279
Sonork: 37318
|
|
|
|
|
WRONG. That is a perfectly valid thing to do. It simply happens during initialization of other global items.
Software Zen: delete this;
|
|
|
|
|
The statement char** t = new char*[5]; allocates 5 elements (0 - 4). However, your for-loop is starting at 5. Your assigning data out of the bounds of your array and therefore overwriting (damaging) adjacent data on the heap.
Either change your for loop to i=4 or extend your array to 6 elements.
Kelly Herald
Software Developer
MPC
|
|
|
|
|
Rickard Andersson
Here is my card, contact me later!
UIN: 50302279
Sonork: 37318
|
|
|
|
|
Check that for loop: looks like you are making 6 iteratons instead of allocated 5:
for(int i = 5; i >= 0; i--)
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
After I have replace the default constructor from the property page class with a constructor having an input caption variable, I am not able to get back to the class wizard on this class. The IDE displays a message: A duplicate insert block exits for class "CInboxPropPage" in the source file (InboxPropPage.cpp, InboxPropPage.h).
However, there is no compilation error. How can I fix the problem so I can still get to the class wizard to add more event handling functions and memory variables?
Elizabeth
|
|
|
|
|
I got it fixed myself. I removed the lines from the old constructor. I guess even I commented them out, the class wizard still treats them as regular code for example //AFX_DATA_INIT was appearing in two places, one at the old(replaced) constructor, and one at the replacing constructor.
Elizabeth
|
|
|
|
|
Hi world;
Anybody know how to display a YUV (or YCrCb) 16 bits image format?
Because I grab image from a PAL-M camera and the image format is 16 bits YCrCb...
I use the GDI! Currently I can dispay B&W (8 bits) and RGB format (32 bits) from others cameras without problems...
Thanks for your help...
Hello World!!!
from Raphaël
|
|
|
|
|
Raphaël Kindt wrote:
Anybody know how to display a YUV (or YCrCb) 16 bits image format?
See if this site helps any:
http://www.wotsit.org/search.asp?page=10&s=graphics
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Hi,
I am developing an attributed ATL COM component in VC 7.0. Everything works fine until I add a web reference. When I add a web reference to some webservice (created in Java), the BUILD process of ATL COM component generates following error while performing registration.
Performing registration
Project : error PRJ0019: A tool returned an error code from "Performing registration"
The point is that if I make the same ATL COM component without using Attributes, the BUILD process returns no error even after adding the web-reference to the web service.
Could anyone be able to help me out in resolving this issue ?
Regards,
Arun
|
|
|
|