|
right, thanx
the scenario you've gave requires .NET being installed on the user's computer. or not?
debug - is my life style
|
|
|
|
|
If you write an app in .NET and give it to somebody on a Windows 98 machine, I believe they would have to download the .NET framework in order to run you apps on their machine. I remember having to download the win32 SDK on win 3.1 back in the day inorder to run some neat program, I don't image this situation is much different.
Cheers
The word of the day is legs, let's go back to my house and spread the word 
|
|
|
|
|
Hallo,
does anyone know where I can get a model of the MFC in ArgoUML? Or does anyone have such a model, he would send to me?
Thanks,
StHubi
"Have no fear, the saint is here!"
|
|
|
|
|
hi,
apart from using PostMessage(), i want to any method or example like callback function, or similar to delegate in C#. so that, worker thread able to communicate with user interface on a event.
i want to learn more on this. any help?
thanks!
jim.
|
|
|
|
|
Hi,
Have u tried PostThreadMessage() API , using this API u can post ur event message to ur worket thread.
for e.g
void yourFunction()
{
BOOL success = PostThreadMessage(
idThread, your thread ID
Msg, // message
wParam, // first message parameter
lParam // second message parameter
);
}
and in your Thread...
DWORD WINAPI yourThreadProc(void *ptr)
{
MESSAGE msg;
while(GetMessage(&msg,NULL, 0,0)
{
switch(msg.message)
{
---do your work accordingly ---
}
}
}
Abhishek Srivastava
Software Engineer (VC++)
India ,Noida
Mobile no 9891492921
|
|
|
|
|
hi all..
ok, this is my problem...
i have a number of namespaces in my app... now, i can call namespace 'b' from namespace 'c', but for some reason, namespace 'b' says that namespace 'a' doesn't exist...
now, i have altered the 'resovle #using...' bit correctly all the class libraries are managed class libraries and they are all VC++.NET libs...
any thoughts guys???
cheers and thanks in advance...
nik
Nik Vogiatzis
PhD Candidate: University of South Australia
+++++++++++++++++++++++++++
Developing new generation Traffic Micro-simulation Tools for Traffic Engineers
em: nikolaos.vogiatzis@unisa.edu.au
|
|
|
|
|
Hi all,
I'd posted this question earlier, but the contents have been deleted!! Anyway, my question is:
I've MDI application with FullServer option selected in step3 of AppWizard and CFormView as base class. In the code I used CreateNewDocument(), CreateNewFrame(), InitailUpdateFrame().The document is getting created, but when I try to save the document, it shows illegal operation.The code works well for CScrollView and CFormView with 'None' option for step3 of appwizard. Can anyone help me solve this?
regards
kevcs2.
|
|
|
|
|
Hi All,
can someone tell me how to close all the messageboxes and dialogboxes belonging to a particular window in an MDI client application.I cannot use CWnd::MessageBox with the corresponding window as parent for displaying a message since any other modal dialog displayed when a messagebox is active will lose it modal property.Hence I'm using AfxMessageBox.I there any other alternative solution for this.
Thanks in advance
Raghu
|
|
|
|
|
I want to make an MFC application that traverses through a series of several (up to 6) dialogs, and then returns to the main dialog.
The user starts at the main dialog box, and makes a selection, closing that dialog and opening a dialog corresponding to the selection. This process would be repeated several times. These dialogs must be able to share data and work together as a single program.
I have tried using modal dialogs but am not able to do anything once the second dialog is opened.
Does anyone have a suggestion?
Thanks,
kvan07
|
|
|
|
|
One solution is a global data structure that stores the univeral information.
Kuphryn
|
|
|
|
|
My problem at this point is not data related. I am unable to actually traverse through a series of dialogs.
kvan07
|
|
|
|
|
How about CPropertySheet & CPropertyPage in wizard mode?
I Touched Osama Bin Ladens Bushy Beard
|
|
|
|
|
Sounds kinda kludgy. Have you considered a property-sheet wizard?
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
I am trying to get two key and a key pusing event.
I already found a way to get the even when pushing two keys at the same time
in PreTranslateMessage by calling GetAsyncKeyState function. However when I keep pushing one key and relase the other there is nothing coming to PreTranslate Message. Anyone knows why?
1. push up arrow up key
2. ( while pushing arrow up key) pushing left arrow key
3. release the left arrow key
after number 3, even I am pushing up arrow key nothing comes to PreTranslateMessage Function I dont' know why?
Regards,
Shin
|
|
|
|
|
Maybe windows ignores the event from the keyboard. It resets only when the key returns to its original state (no pressed).
Kuphryn
|
|
|
|
|
thanks for your comment.
so when one key is released, make keyborads state to nothing is pressed, right. Do you know how to make it by any chance?
Otherwise, I will do some research.
Thank you very much for your help.
Shin
|
|
|
|
|
I have added an about menu item to the end of the system menu and I can't remember how to handle those messages?
I am using plain C/SDK code....so no MFC please...
I have looked into WM_COMMAND and WM_SYSCOMMAND and can't seem to get either working???
Heres how I added the MENU item
<small>inside WM_INITDIALOG</small>
HMENU hMenu = GetSystemMenu(hWndDlg, FALSE);
AppendMenu(hMenu, MF_SEPARATOR, 0, NULL);
AppendMenu(hMenu, MF_STRING, IDR_ABOUT_MENU, "About...");
The word of the day is legs, let's go back to my house and spread the word 
|
|
|
|
|
When that menu item is selected, a WM_SYSCOMMAND message will be sent, with IDR_ABOUT_MENU in wParam .
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Can sombody help me?
I`ve read all postings but I can`t find something it helps me!
Why different the result of PdhGetFormattedCounterValue function(ex - "\\Process(process_name)\\% Processor Time") and Windows Task Manager?
O/S : Windows 2000 Server.
CPU : Dual-CPU
single CPU, Windows 2000 professional is no problem.
help me!!!
|
|
|
|
|
Can anyone tell me what is a good tutorial so I can learn staff like open another windows by pressing a button or sending one signal by pressing a button.
Thank you
|
|
|
|
|
There are tons of samples for biggers in the codeproject, just navigate to the section that you want to learn on the left handside at www.codeproject.com
I Touched Osama Bin Ladens Bushy Beard
|
|
|
|
|
In VC6, an ActiveX control was added to a project by selecting Project/Add to Project/Components and Controls, then selecting the desired control from the 'Registered ActiveX Controls' folder. When you did this, VC would create a wrapper class for the control and add the .cpp and .h files to your project.
How do you create these wrapper classes in VC7.1? I can add the component to the toolbox(an analogous operation to the 'Add to Project' command from VC6), but no wrapper class is generated.
Does anyone know how to get the wrapper class created?
Thanks in advance.
|
|
|
|
|
Hello all.. I insert bmp images in to clistctrl as followed,
m_myListCtrl.InsertItem(0,extension,image1)
m_myListCtrl.InsertItem(0,extension,image2)
m_myListCtrl.InsertItem(0,extension,image4)
then I want change the image . I tried t use SetItemState. but it doesn't work ...
m_myListCtrl.SetItemState(j,0,LVIF_IMAGE);
|
|
|
|
|
Hey all,
I am encountering the following problem.
My program crashes with I try to read a netCDF file and display it in VC++ with OpenGL.
I have created a Win32 Application, and it works just fine and displays any other graphics code. I am a new VC++ user and hence dont know much stuff in it. I would highly appreciate if anyone could help me out. I would like to know at which point should I read the netcdf file the following is my code
#include <windows.h> /* must include this before GL/gl.h */
#include <GL/gl.h> /* OpenGL header file */
#include <GL/glu.h> /* OpenGL utilities header file */
#include <stdio.h>
#include <math.h>
#include <netcdf.h>
#include <stdio.h>
#include <string.h>
// Variable definitions. The comments contain the dimension names.
long lat[11]; // lat
char lat_units[6];
long lon[11]; // lon
char lon_units[6];
long depth[11]; // depth
char depth_units[6];
long time[60]; // time
char time_units[7];
float magnitude[60][11][11][11]; // time, lat, lon, depth
char magnitude_units[10];
double magnitude_valid_range[2];
void
read_netCDF_file ()
{
//# func_description
// This routine reads the data from plume1.nc into memory.
int fd;
long start[MAX_NC_VARS];
long end[MAX_NC_VARS];
// Open the netCDF file.
fd = ncopen("plume1.nc", NC_NOWRITE);
// Initialize start so all elements are zero.
// bzero(start, MAX_NC_VARS * sizeof(long));
memset(start,0, MAX_NC_VARS * sizeof(long));
// Read in the variables and their attributes.
// Read: lat.
end[0] = 11;
ncvarget(fd, 0, start, end, lat);
// Read: lat_units.
ncattget(fd, 0, "units", lat_units);
// Read: lon.
end[0] = 11;
ncvarget(fd, 1, start, end, lon);
// Read: lon_units.
ncattget(fd, 1, "units", lon_units);
// Read: depth.
end[0] = 11;
ncvarget(fd, 2, start, end, depth);
// Read: depth_units.
ncattget(fd, 2, "units", depth_units);
// Read: time.
end[0] = 60;
ncvarget(fd, 3, start, end, time);
// Read: time_units.
ncattget(fd, 3, "units", time_units);
// Read: magnitude.
end[0] = 60; end[1] = 11; end[2] = 11; end[3] = 11;
ncvarget(fd, 4, start, end, magnitude);
// Read: magnitude_units.
ncattget(fd, 4, "units", magnitude_units);
// Read: magnitude_valid_range.
ncattget(fd, 4, "valid_range", magnitude_valid_range);
// Read in the Global Attributes.
// Close the netCDF file.
ncclose(fd);
}
void
display()
{
GLint x = 0; // latitude variable
GLint y = 0; // longitude variable
GLint z = 0; // depth variable
GLint t = 0; // time variable
float mag ; //magnitude at pt [x,y,z,t]
int color_code ; // color code which will be displayed
// so that accordingly the point can be colored
glClear(GL_COLOR_BUFFER_BIT);
// glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
// glClearColor(1.0f, 1.0f, 1.0f, 0.0f);
// glClearDepth(1.0f); // Depth Buffer Setup
// glEnable(GL_DEPTH_TEST); // Enables Depth Testing
// glDepthFunc(GL_LEQUAL);
glColor3f(1.0f,0.0f,0.0f);
// glBegin(GL_POINTS);
/* for(t=0;t<2;t++) {
for(x=0;x<11;x++) {
for(y=0;y<11;y++) {
for(z=0;z<11;z++) {
mag = magnitude[t][x][y][z];
//color_code = getcolor(mag);
glVertex3i(x,y,z);
}
}
}
}*/
glBegin(GL_TRIANGLES); // Drawing Using Triangles
glVertex3f( 0.0f, 1.0f, 0.0f); // Top
glVertex3f(-1.0f,-1.0f, 0.0f); // Bottom Left
glVertex3f( 1.0f,-1.0f, 0.0f); // Bottom Right
glEnd();
// glEnd();
glFlush();
}
LONG WINAPI
WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
static PAINTSTRUCT ps;
switch(uMsg) {
case WM_PAINT:
display();
BeginPaint(hWnd, &ps);
EndPaint(hWnd, &ps);
return 0;
case WM_SIZE:
glViewport(0, 0, LOWORD(lParam), HIWORD(lParam));
PostMessage(hWnd, WM_PAINT, 0, 0);
return 0;
case WM_CHAR:
switch (wParam) { // wParam is the parameter which is passed in from the window which is
// finally displayed here we can take in the key sequences from the
// screen
case 27: /* ESC key */
PostQuitMessage(0);
break;
}
return 0;
case WM_CLOSE:
PostQuitMessage(0);
return 0;
}
return DefWindowProc(hWnd, uMsg, wParam, lParam);
}
HWND
CreateOpenGLWindow(char* title, int x, int y, int width, int height,
BYTE type, DWORD flags)
{
int pf;
HDC hDC;
HWND hWnd;
WNDCLASS wc;
PIXELFORMATDESCRIPTOR pfd;
static HINSTANCE hInstance = 0;
/* only register the window class once - use hInstance as a flag. */
if (!hInstance) {
hInstance = GetModuleHandle(NULL);
wc.style = CS_OWNDC;
wc.lpfnWndProc = (WNDPROC)WindowProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInstance;
wc.hIcon = LoadIcon(NULL, IDI_WINLOGO);
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = NULL;
wc.lpszMenuName = NULL;
wc.lpszClassName = "OpenGL";
if (!RegisterClass(&wc)) {
MessageBox(NULL, "RegisterClass() failed: "
"Cannot register window class.", "Error", MB_OK);
return NULL;
}
}
hWnd = CreateWindow("OpenGL", title, WS_OVERLAPPEDWINDOW |
WS_CLIPSIBLINGS | WS_CLIPCHILDREN,
x, y, width, height, NULL, NULL, hInstance, NULL);
if (hWnd == NULL) {
MessageBox(NULL, "CreateWindow() failed: Cannot create a window.",
"Error", MB_OK);
return NULL;
}
hDC = GetDC(hWnd);
/* there is no guarantee that the contents of the stack that become
the pfd are zeroed, therefore _make sure_ to clear these bits. */
memset(&pfd, 0, sizeof(pfd));
pfd.nSize = sizeof(pfd);
pfd.nVersion = 1;
pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | flags;
pfd.iPixelType = type;
pfd.cColorBits = 32;
pf = ChoosePixelFormat(hDC, &pfd);
if (pf == 0) {
MessageBox(NULL, "ChoosePixelFormat() failed: "
"Cannot find a suitable pixel format.", "Error", MB_OK);
return 0;
}
if (SetPixelFormat(hDC, pf, &pfd) == FALSE) {
MessageBox(NULL, "SetPixelFormat() failed: "
"Cannot set format specified.", "Error", MB_OK);
return 0;
}
DescribePixelFormat(hDC, pf, sizeof(PIXELFORMATDESCRIPTOR), &pfd);
ReleaseDC( hWnd, hDC );
return hWnd;
}
int APIENTRY
WinMain(HINSTANCE hCurrentInst, HINSTANCE hPreviousInst,
LPSTR lpszCmdLine, int nCmdShow)
{
HDC hDC; /* device context */
HGLRC hRC; /* opengl context */
HWND hWnd; /* window */
MSG msg; /* message */
read_netCDF_file();
hWnd = CreateOpenGLWindow("minimal", 0, 0, 256, 256, PFD_TYPE_RGBA, 0);
if (hWnd == NULL)
exit(1);
hDC = GetDC(hWnd);
hRC = wglCreateContext(hDC);
wglMakeCurrent(hDC, hRC);
ShowWindow(hWnd, nCmdShow);
while(GetMessage(&msg, hWnd, 0, 0)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
wglMakeCurrent(NULL, NULL);
ReleaseDC( hWnd, hDC );
wglDeleteContext(hRC);
DestroyWindow(hWnd);
return msg.wParam;
}
I am new user of VC++ and Win32 Programming.
Regards,
kris
Help Required ASAP !!!
|
|
|
|
|
Any reason you're using C instead of C++ ? When you say it 'crashes', what error are you getting ? Are you able to debug ?
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|