|
Hi all,
how can I add data to each MS Chart series during runtime?
Thanks in advance,
Marc Soleda
p.d: what happens with MS Chart?? I can't find documentation...
|
|
|
|
|
Hi everybody
I copied this example from a book on game MFC and it`s give me an error in the liking phase
Linking...
test.obj : error LNK2001: unresolved external symbol __imp__MessageBoxA@16
Debug/test.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
i know is probably something tedious
tks
B
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <windowsx.h>
int WINAPI WinMain(HINSTANCE hinstance,HINSTANCE hprevinstance,LPSTR lpcmdline,int ncmdshow)
{
// call message box api with NULL for parent window handle
MessageBox(NULL, "THERE CAN BE ONLY ONE!!!","MY FIRST WINDOWS PROGRAM",MB_OK | MB_ICONEXCLAMATION);
// exit program
return(0);
}
|
|
|
|
|
The error means the compiler can't find the actual code for the function MessageBox. If you do a quick search for MessageBox on www.msdn.com you will see that to use this function you need:
Header Declared in Winuser.h, include Windows.h
Import library User32.lib
So you included Windows.h somewhere (otherwise you'd get a compile error) and in Project ->Settings -> Link you write in User32.lib.
Try that, I think it should work.
|
|
|
|
|
Hi ,
I have made a multithreaded application , Problem is that I want to know how many threads are right now in my application. As user can create as many threads as he wants, on every user request it creates a new instance of mythreadclass , which is inherited from CWinThread . And how to delete these threads when application finishes .
Thanks
ZINC !
HELLO
|
|
|
|
|
The CreateToolhelp32Snapshot function takes a snapshot of the specified processes in the system, as well as the heaps, modules, and threads used by these processes.
TH32CS_SNAPTHREAD - Includes all threads in the system in the snapshot. To enumerate the threads, see Thread32First . To identify the threads that belong to a specific process, compare its process identifier to the th32OwnerProcessID member of the THREADENTRY32 structure when enumerating the threads.
Use GetCurrentProcessId to get the process id for your program.
|
|
|
|
|
I am learning to use Visual Studio to write C++ programs. The last exercise I did from the book resulted in the message "error C2146: syntax error : missing ';' before identifier 'HwndMSWheel'". What am I doing wrong?
Help!!!
|
|
|
|
|
It's hard to guess from the info you provide. Post a code snippet and someone will probably be able to tell you what's wrong in it.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
This was an exercise to learn to create an application window. Here is the code, a very short program.
// EX13_01.CPP
// An elementary MFC program
#include <afxwin.h> // For the class library
// Application class definition
class COurApp:public CWinApp
{
public:
virtual BOOL InitInstance();
};
//Window class definition
class COurWnd:public CFrameWnd
{
public:
// Class constructor
COurWnd()
{
Create(o, "Our Dumb MFC Application");
}
};
// Function to create an instance of the main window
BOOL COurApp::InitInstance(void)
{
// Construct a window object in the free store
m_pMainWnd = new COurWnd;
m_pMainWnd->ShowWindow(m_nCmdShow); // .. and display it
return TRUE;
}
// Application object definition at global scope
COurApp AnApplication; // Define an application object
|
|
|
|
|
Anonymous wrote:
This was an exercise to learn to create an application window. Here is the code, a very short program.
But this isn't the file in which you were getting a compilation error, is it? You said the error was "error C2146: syntax error : missing ';' before identifier 'HwndMSWheel'" and I can't see HwndMSWheel anywhere in the code you posted...
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
How about:
COurWnd::COurWnd()
{
}
BOOL COurApp::InitInstance(void)
{
COurWnd *pMainWnd = new COurWnd;
m_pMainWnd = pMainWnd;
pMainWnd->LoadFrame(IDR_MAINFRAME, WS_OVERLAPPEDWINDOW, NULL, NULL);
pMainWnd->ShowWindow(m_nCmdShow);
pMainWnd->UpdateWindow();
return TRUE;
}
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hi there...
I've been trying to print some graphics done with gdi+..
ForExample:
Graphics graphics(pDC->m_hDC);<br />
graphics.FillRectangle(&(SolidBrush(Color(255,2,90,50))),10,10,400,300);<br />
graphics.FillEllipse(&(SolidBrush(Color(100,255,255,100))),10,10,300,300);
On my screen it looks exactly like want it to...but when i'm trying to print it on our
HP1050C Plotter the alpha transparent areas were opaque..
Does anyone know this problem??
|
|
|
|
|
Probably a driver issue. Try drawing to a memory bitmap, then blitting this to the printer DC (assuming the printer driver supports blitting).
---------------------------------------- the ocean is full because everyone's crying
|
|
|
|
|
Yes, it's probably a driver issue...
But this just a little demo i wrote... actual i tested it for our GIS-Software...
and there i can't just draw it into a membitmap...the memory would blow up^^
btw. pls. excuse my bad english...)
|
|
|
|
|
Hi all,
I am using MS flex grid to show my application data. There is a point when I need to Input from the user so that I can proceed the working. What I am doing is I have placed an edit box control at design time. Then I get pointer to it using GetDlgItem. and then I am calling SetWindowPos function to display it on a specific cell of the grid. But the edit box do not get displayed.
My code looks like:
CEdit *m_pEditValue = (CEdit*) GetDlgItem(IDC_EDIT_VALUE);
m_pEditValue->SetWindowText("Displayed");
m_pEditValue->SetWindowPos(&wndTop,m_flexgrid.GetCellLeft(),m_flexgrid.GetCellTop(),m_flexgrid.GetCellWidth(),m_flexgrid.GetCellHeight(),SWP_SHOWWINDOW);
The program does not give any error but It does not show the edit box. I think it is behind the grid and that means &wndTop is not making it a topmost window.
Any suggestion please ?
Thanx in advance.
Ritu Kwatra
|
|
|
|
|
hi
i have used:
FILE *new = fopen("bla.txt","r+");
to edit a file that i have created earlier.
i need now to delete the last line in the file and add a new one.
How can i do that without overwriting the old line?
/\|-||\/|/\|)
|
|
|
|
|
Halawlaws wrote:
i need now to delete the last line in the file and add a new one.
How can i do that without overwriting the old line?
These two requirements contradict each other. Deleting a line and replacing it with another is the same as overwriting.
If the old and new lines are the same length, just use fseek() to position the file pointer to the beginning of the line. Otherwise, you'll need to read each line in the file into a temporary file sans the last line. Write the new line to the temporary file. Close both files. Delete the original file. Rename the temporary file. Make sense?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
hey
I can't use fseek coz they have different size so i will try the second method only how can i delete the original file and rename the temporary one.
What functions do i use?
/\|-||\/|/\|)
|
|
|
|
|
Halawlaws wrote:
...how can i delete the original file and rename the temporary one.
What functions do i use?
remove() and rename() come to mind.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Thx for ur help man but take it easy I am not an expert
/\|-||\/|/\|)
|
|
|
|
|
How can i get application path?
|
|
|
|
|
|
Hello
You can extract it from module file name (GetModuleFileName ).
Andrew
|
|
|
|
|
<br />
char BufferApplicationFile[MAX_PATH] = {0};<br />
if (GetModuleFileName(AfxGetInstanceHandle(), BufferApplicationFile, MAX_PATH) == 0) {<br />
}<br />
|
|
|
|
|
abd.Eskandari wrote: How can i get application path?
TCHAR str[MAX_PATH];
GetModuleFileName(NULL,str,MAX_PATH);
OutputDebugString(str);
TCHAR szFileName[MAX_PATH];
_splitpath(str,NULL,NULL,szFileName,NULL);
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
[CODE]http://img301.imageshack.us/img301/5328/closewait0lw.jpg[/CODE]
1. what does "close wait" means?
2. what does "fin_wait2" means?
i understand that these are socket status but
- what do they mean? the socket is waiting for server? the socket is shutting down but waiting for certain event to happen before it's allowed to shutdown?
- what situations causes them?
- it seems that the socket is waiting for something, how can i stop the close wait/fin_wait2 and shutdown the socket? (gracefully or forcefully)
it seems that sockets on "close wait" and "fin_wait2" on my program are the ones with problems
please advise
|
|
|
|