|
Member 4038335 wrote: what is rong with it ?
Did you do as I suggested (and then obviously recompile)?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
well i saw th poblem there i rewrite the code but stil i have same problem when i use 'o' or any letter after it will shift outside of printable chars. of ASCII how can i fix that??
#include <stdio.h>
#include <string.h>
#include <conio.h>
#include <cctype>
#include <cstdlib>
char text[256];
int m,c,men;
void cez(char *Text)
{
char key[20];
printf("%s\n", "dwse text ");
gets_s(Text,256);
printf("%s\n", "dwse to klidi kriptografisis");
gets_s(key,20);
for(int i=0; key[i] !='\0'; i++)
{
if(!isdigit(key[i]))
{
printf ("Your key is not number! Try again \n");
return;
}
}
int k = atoi(key);
for(m = 0; m < strlen(text); ++m)
{
c = text[m] + k;
if(c > 256) c -= 256;
Text[m] = c;
}
}
void desh(char *Text)
{
char key[20];
printf("%s\n", "dwse to klidi apokriptografisis");
gets_s(key,20);
for(int i=0; key[i] !='\0'; i++)
{
if(!isdigit(key[i]))
{
printf ("Your key is not number! Try again \n");
return;
}
}
int k = atoi(key);
for(m = 0; m < strlen(text); ++m)
{
c = Text[m] - k;
if(c < 256) c+=256;
Text[m] = c;
}
}
int main()
{ printf("=======================\n KRYPTOGRAFISH \n=======================\n");
cez(text);
printf("%s \n", text);
printf("=======================\n APOKRYPTOGRAFISH \n=======================\n");
desh(text);
printf("%s \n", text);
}
|
|
|
|
|
Member 4038335 wrote: well i saw th poblem there i rewrite the code...
But your code snippet shows otherwise. Until you address the problem, the outcome will remain the same.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hi All,
Im using the two tree controls in my project.This tree control has list folders.That folders contains some .txt file.I need to drag the .txt files from first tree to another one.I dont need to darg & drop the folders.
Thanks in advance.
Regards,
Anitha
modified on Saturday, November 22, 2008 1:17 AM
|
|
|
|
|
When the user drags an item in the tree control the control will send you a TVN_BEGINDRAG notification, also look into the DoDragDrop function for starters, there is a lot of help online about doing Drag And Drop, also here on Codeproject, and of course, google is your friend.
|
|
|
|
|
Hi!
i have a MFC project by Single Document.
i remove title bar and any border on form (main form) for my project.
but a thin line around of the form!
i don't want any line. what do i do?
Zo.Naderi-Iran
|
|
|
|
|
i resolve my problem.
in OnCreate in CMainFrame Class, i call
ModifyStyle(WS_BORDER, NULL);
my wrong was :
ModifyStyle(NULL, WS_BORDER);
thank you
Zo.Naderi-Iran
|
|
|
|
|
In the future you should post the code relevant to your problem. If you would have posted that line of code someone would have instantly recognized the error.
Best Wishes,
-David Delaune
|
|
|
|
|
Hi all,
Printing matter is greater than one page but when i generate the preview i can view only single page same problem for printing only single page is print.
i m use this also.
pInfo->m_bContinuePrinting=TRUE;
but after use this the problem still same,there is no effects.
please help he for this.
i waiting for your valuable suggestions and views.
thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
u must be having a lot of data ,that cannot fit in a page ,so u need
to shift viewport origin using setviewportorigin() in OnPrepareDC method ...see msdn for more
info.......
best regards
|
|
|
|
|
Hello, it goes wrong again but I don't know where to make it right.
Last time the code that should be no wrong coz I builded it successfully just stuck in type conversion. I mean no pragma use or others. It just my fault that just uses the code without make suitable type.
Now I make my own project that uses bitmap. Finally, I've build it successfully and the compiled result's shown below.
====================================================================================================
------ Rebuild All started: Project: KungfuPanda, Configuration: Debug Win32 ------
Deleting intermediate and output files for project 'KungfuPanda', configuration 'Debug|Win32'
Compiling...
PO.cpp
c:\program files\microsoft sdks\windows\v6.0a\include\gl\glaux.h(17) : warning C4068: unknown pragma
c:\program files\microsoft sdks\windows\v6.0a\include\gl\glaux.h(374) : warning C4068: unknown pragma
c:\documents and settings\satellite\my documents\visual studio 2008\projects\vc++ project\kungfupanda\kungfupanda\po.cpp(33) : warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
c:\program files\microsoft visual studio 9.0\vc\include\stdio.h(237) : see declaration of 'fopen'
Compiling manifest to resources...
Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
Copyright (C) Microsoft Corporation. All rights reserved.
Linking...
LINK : C:\Documents and Settings\SATELLITE\My Documents\Visual Studio 2008\Projects\VC++ PROJECT\KungfuPanda\Debug\KungfuPanda.exe not found or not built by the last incremental link; performing full link
Embedding manifest...
Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
Copyright (C) Microsoft Corporation. All rights reserved.
Build log was saved at "file://c:\Documents and Settings\SATELLITE\My Documents\Visual Studio 2008\Projects\VC++ PROJECT\KungfuPanda\KungfuPanda\Debug\BuildLog.htm"
KungfuPanda - 0 error(s), 3 warning(s)
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
=====================================================================================================
This make me very happy, coz this is my first project but something bad appear while I start debuging.
It just like before, I mean while the windows form appear "would you like to run in fullscreen mode", whether I choose yes or no, it just start the appearence then disappear in seconds. Maybe in milliseconds.
What cause this problem. For every one who knows this case, please tell me. How to prevent the result not to disappear while it just start running ? A comment would be a real help.
Here's the debugging log
===================================================================================================
'KungfuPanda.exe': Loaded 'C:\Documents and Settings\SATELLITE\My Documents\Visual Studio 2008\Projects\VC++ PROJECT\KungfuPanda\Debug\KungfuPanda.exe', Symbols loaded.
'KungfuPanda.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll'
'KungfuPanda.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll'
'KungfuPanda.exe': Loaded 'C:\WINDOWS\system32\glu32.dll'
'KungfuPanda.exe': Loaded 'C:\WINDOWS\system32\msvcrt.dll'
'KungfuPanda.exe': Loaded 'C:\WINDOWS\system32\opengl32.dll'
'KungfuPanda.exe': Loaded 'C:\WINDOWS\system32\advapi32.dll'
'KungfuPanda.exe': Loaded 'C:\WINDOWS\system32\rpcrt4.dll'
'KungfuPanda.exe': Loaded 'C:\WINDOWS\system32\gdi32.dll'
'KungfuPanda.exe': Loaded 'C:\WINDOWS\system32\user32.dll'
'KungfuPanda.exe': Loaded 'C:\WINDOWS\system32\ddraw.dll'
'KungfuPanda.exe': Loaded 'C:\WINDOWS\system32\dciman32.dll'
'KungfuPanda.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC90.DebugCRT_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww_597c3456\msvcr90d.dll'
'KungfuPanda.exe': Loaded 'C:\WINDOWS\system32\imm32.dll'
'KungfuPanda.exe': Loaded 'C:\WINDOWS\system32\lpk.dll'
'KungfuPanda.exe': Loaded 'C:\WINDOWS\system32\usp10.dll'
'KungfuPanda.exe': Loaded 'C:\WINDOWS\system32\avgrsstx.dll'
'KungfuPanda.exe': Loaded 'C:\WINDOWS\system32\uxtheme.dll'
'KungfuPanda.exe': Loaded 'C:\WINDOWS\system32\MSCTF.dll'
'KungfuPanda.exe': Loaded 'C:\WINDOWS\system32\version.dll'
'KungfuPanda.exe': Unloaded 'C:\WINDOWS\system32\version.dll'
'KungfuPanda.exe': Loaded 'C:\WINDOWS\system32\MSCTFIME.IME'
'KungfuPanda.exe': Loaded 'C:\WINDOWS\system32\ole32.dll'
'KungfuPanda.exe': Loaded 'C:\WINDOWS\system32\oleaut32.dll'
'KungfuPanda.exe': Loaded 'C:\WINDOWS\system32\iglicd32.dll', Binary was not built with debug information.
'KungfuPanda.exe': Loaded 'C:\WINDOWS\system32\igldev32.dll', Binary was not built with debug information.
'KungfuPanda.exe': Loaded 'C:\WINDOWS\system32\mcd32.dll'
'KungfuPanda.exe': Unloaded 'C:\WINDOWS\system32\mcd32.dll'
The program '[896] KungfuPanda.exe: Native' has exited with code 0 (0x0).
===================================================================================================
This is my first project code; If I run it should be a rotating box that contain Po bitmap.
====================================================================================================
#include <windows.h>
#include <stdio.h>
#include <gl\gl.h>
#include <gl\glu.h>
#include <gl\glaux.h>
HDC hDC=NULL;
HGLRC hRC=NULL;
HWND hWnd=NULL;
HINSTANCE hInstance;
bool keys[256];
bool active=TRUE;
bool fullscreen=TRUE;
GLfloat xrot;
GLfloat yrot;
GLfloat zrot;
GLuint texture[1];
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
AUX_RGBImageRec *LoadBMP(char *Filename)
{
FILE *File=NULL;
if (!Filename)
{
return NULL;
}
File=fopen(Filename,"r");
if (File)
{
fclose(File);
return auxDIBImageLoad(Filename);
}
return NULL;
}
int LoadGLTextures()
{
int Status=FALSE;
AUX_RGBImageRec *TextureImage[1];
memset(TextureImage,0,sizeof(void *)*1);
if (TextureImage[0]=LoadBMP("Data/DragonWarrior.bmp"))
{
Status=TRUE;
glGenTextures(1, &texture[0]);
glBindTexture(GL_TEXTURE_2D, texture[0]);
glTexImage2D(GL_TEXTURE_2D, 0, 3, TextureImage[0]->sizeX, TextureImage[0]->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, TextureImage[0]->data);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
}
if (TextureImage[0])
{
if (TextureImage[0]->data)
{
free(TextureImage[0]->data);
}
free(TextureImage[0]);
}
return Status;
}
GLvoid ReSizeGLScene(GLsizei width, GLsizei height)
{
if (height==0)
{
height=1;
}
glViewport(0,0,width,height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
// Calculate The Aspect Ratio Of The Window
gluPerspective(45.0f,(GLfloat)width/(GLfloat)height,0.1f,100.0f);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}
int InitGL(GLvoid)
{
if (!LoadGLTextures())
{
return FALSE;
}
glEnable(GL_TEXTURE_2D);
glShadeModel(GL_SMOOTH);
glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
glClearDepth(1.0f);
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LEQUAL);
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
return TRUE;
}
int DrawGLScene(GLvoid)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glTranslatef(0.0f,0.0f,-5.0f);
glRotatef(xrot,1.0f,0.0f,0.0f);
glRotatef(yrot,0.0f,1.0f,0.0f);
glRotatef(zrot,0.0f,0.0f,1.0f);
glBindTexture(GL_TEXTURE_2D, texture[0]);
glBegin(GL_QUADS);
// muka depan
glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f, -1.0f, 1.0f);
glTexCoord2f(1.0f, 0.0f); glVertex3f( 1.0f, -1.0f, 1.0f);
glTexCoord2f(1.0f, 1.0f); glVertex3f( 1.0f, 1.0f, 1.0f);
glTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f, 1.0f, 1.0f);
// muka belakang
glTexCoord2f(1.0f, 0.0f); glVertex3f(-1.0f, -1.0f, -1.0f);
glTexCoord2f(1.0f, 1.0f); glVertex3f(-1.0f, 1.0f, -1.0f);
glTexCoord2f(0.0f, 1.0f); glVertex3f( 1.0f, 1.0f, -1.0f);
glTexCoord2f(0.0f, 0.0f); glVertex3f( 1.0f, -1.0f, -1.0f);
// muka atas
glTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f, 1.0f, -1.0f);
glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f, 1.0f, 1.0f);
glTexCoord2f(1.0f, 0.0f); glVertex3f( 1.0f, 1.0f, 1.0f);
glTexCoord2f(1.0f, 1.0f); glVertex3f( 1.0f, 1.0f, -1.0f);
// muka bawah
glTexCoord2f(1.0f, 1.0f); glVertex3f(-1.0f, -1.0f, -1.0f);
glTexCoord2f(0.0f, 1.0f); glVertex3f( 1.0f, -1.0f, -1.0f);
glTexCoord2f(0.0f, 0.0f); glVertex3f( 1.0f, -1.0f, 1.0f);
glTexCoord2f(1.0f, 0.0f); glVertex3f(-1.0f, -1.0f, 1.0f);
// muka kanan
glTexCoord2f(1.0f, 0.0f); glVertex3f( 1.0f, -1.0f, -1.0f);
glTexCoord2f(1.0f, 1.0f); glVertex3f( 1.0f, 1.0f, -1.0f);
glTexCoord2f(0.0f, 1.0f); glVertex3f( 1.0f, 1.0f, 1.0f);
glTexCoord2f(0.0f, 0.0f); glVertex3f( 1.0f, -1.0f, 1.0f);
// muka kiri
glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f, -1.0f, -1.0f);
glTexCoord2f(1.0f, 0.0f); glVertex3f(-1.0f, -1.0f, 1.0f);
glTexCoord2f(1.0f, 1.0f); glVertex3f(-1.0f, 1.0f, 1.0f);
glTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f, 1.0f, -1.0f);
glEnd();
xrot+=0.3f;
yrot+=0.2f;
zrot+=0.4f;
return TRUE;
}
GLvoid KillGLWindow(GLvoid)
{
if (fullscreen)
{
ChangeDisplaySettings(NULL,0);
ShowCursor(TRUE);
}
if (hRC)
{
if (!wglMakeCurrent(NULL,NULL))
{
MessageBox(NULL,"Release Of DC And RC Failed.","SHUTDOWN ERROR",MB_OK | MB_ICONINFORMATION);
}
if (!wglDeleteContext(hRC))
{
MessageBox(NULL,"Release Rendering Context Failed.","SHUTDOWN ERROR",MB_OK | MB_ICONINFORMATION);
}
hRC=NULL;
}
if (hDC && !ReleaseDC(hWnd,hDC))
{
MessageBox(NULL,"Release Device Context Failed.","SHUTDOWN ERROR",MB_OK | MB_ICONINFORMATION);
hDC=NULL;
}
if (hWnd && !DestroyWindow(hWnd))
{
MessageBox(NULL,"Could Not Release hWnd.","SHUTDOWN ERROR",MB_OK | MB_ICONINFORMATION);
hWnd=NULL;
}
if (!UnregisterClass("OpenGL",hInstance))
{
MessageBox(NULL,"Could Not Unregister Class.","SHUTDOWN ERROR",MB_OK | MB_ICONINFORMATION);
hInstance=NULL;
}
}
BOOL CreateGLWindow(char* title, int width, int height, int bits, bool fullscreenflag)
{
GLuint PixelFormat;
WNDCLASS wc;
DWORD dwExStyle;
DWORD dwStyle;
RECT WindowRect;
WindowRect.left=(long)0;
WindowRect.right=(long)width;
WindowRect.top=(long)0;
WindowRect.bottom=(long)height;
fullscreen=fullscreenflag;
hInstance = GetModuleHandle(NULL);
wc.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
wc.lpfnWndProc = (WNDPROC) WndProc;
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,"Failed To Register The Window Class.","ERROR",MB_OK|MB_ICONEXCLAMATION);
return FALSE;
}
if (fullscreen)
{
DEVMODE dmScreenSettings;
memset(&dmScreenSettings,0,sizeof(dmScreenSettings));
dmScreenSettings.dmSize=sizeof(dmScreenSettings);
dmScreenSettings.dmPelsWidth = width;
dmScreenSettings.dmPelsHeight = height;
dmScreenSettings.dmBitsPerPel = bits;
dmScreenSettings.dmFields=DM_BITSPERPEL|DM_PELSWIDTH|DM_PELSHEIGHT;
if (ChangeDisplaySettings(&dmScreenSettings,CDS_FULLSCREEN)!=DISP_CHANGE_SUCCESSFUL)
{
if (MessageBox(NULL,"The Requested Fullscreen Mode Is Not Supported By\nYour Video Card. Use Windowed Mode Instead?","NeHe GL",MB_YESNO|MB_ICONEXCLAMATION)==IDYES)
{
fullscreen=FALSE;
}
else
{
MessageBox(NULL,"Program Will Now Close.","ERROR",MB_OK|MB_ICONSTOP);
return FALSE;
}
}
}
if (fullscreen)
{
dwExStyle=WS_EX_APPWINDOW;
dwStyle=WS_POPUP;
ShowCursor(FALSE);
}
else
{
dwExStyle=WS_EX_APPWINDOW | WS_EX_WINDOWEDGE;
dwStyle=WS_OVERLAPPEDWINDOW;
}
AdjustWindowRectEx(&WindowRect, dwStyle, FALSE, dwExStyle);
// Create The Window
if (!(hWnd=CreateWindowEx( dwExStyle,
"OpenGL",
title,
dwStyle |
WS_CLIPSIBLINGS |
WS_CLIPCHILDREN,
0, 0,
WindowRect.right-WindowRect.left,
WindowRect.bottom-WindowRect.top,
NULL,
NULL,
hInstance,
NULL)))
{
KillGLWindow();
MessageBox(NULL,"Window Creation Error.","ERROR",MB_OK|MB_ICONEXCLAMATION);
return FALSE;
}
static PIXELFORMATDESCRIPTOR pfd=
{
sizeof(PIXELFORMATDESCRIPTOR),
1,
PFD_DRAW_TO_WINDOW |
PFD_SUPPORT_OPENGL |
PFD_DOUBLEBUFFER,
PFD_TYPE_RGBA,
bits,
0, 0, 0, 0, 0, 0,
0,
0,
0,
0, 0, 0, 0,
16,
0,
0,
PFD_MAIN_PLANE,
0,
0, 0, 0
};
if (!(hDC=GetDC(hWnd)))
{
KillGLWindow();
MessageBox(NULL,"Can't Create A GL Device Context.","ERROR",MB_OK|MB_ICONEXCLAMATION);
return FALSE;
}
if (!(PixelFormat=ChoosePixelFormat(hDC,&pfd)))
{
KillGLWindow();
MessageBox(NULL,"Can't Find A Suitable PixelFormat.","ERROR",MB_OK|MB_ICONEXCLAMATION);
return FALSE;
}
if(!SetPixelFormat(hDC,PixelFormat,&pfd))
{
KillGLWindow();
MessageBox(NULL,"Can't Set The PixelFormat.","ERROR",MB_OK|MB_ICONEXCLAMATION);
return FALSE;
}
if (!(hRC=wglCreateContext(hDC)))
{
KillGLWindow();
MessageBox(NULL,"Can't Create A GL Rendering Context.","ERROR",MB_OK|MB_ICONEXCLAMATION);
return FALSE;
}
if(!wglMakeCurrent(hDC,hRC))
{
KillGLWindow();
MessageBox(NULL,"Can't Activate The GL Rendering Context.","ERROR",MB_OK|MB_ICONEXCLAMATION);
return FALSE;
}
ShowWindow(hWnd,SW_SHOW);
SetForegroundWindow(hWnd);
SetFocus(hWnd);
ReSizeGLScene(width, height);
if (!InitGL())
{
KillGLWindow();
MessageBox(NULL,"Initialization Failed.","ERROR",MB_OK|MB_ICONEXCLAMATION);
return FALSE;
}
return TRUE;
}
LRESULT CALLBACK WndProc( HWND hWnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam)
{
switch (uMsg)
{
case WM_ACTIVATE:
{
if (!HIWORD(wParam))
{
active=TRUE;
}
else
{
active=FALSE;
}
return 0;
}
case WM_SYSCOMMAND:
{
switch (wParam)
{
case SC_SCREENSAVE:
case SC_MONITORPOWER:
return 0;
}
break;
}
case WM_CLOSE:
{
PostQuitMessage(0);
return 0;
}
case WM_KEYDOWN:
{
keys[wParam] = TRUE;
return 0;
}
case WM_KEYUP:
{
keys[wParam] = FALSE;
return 0;
}
case WM_SIZE:
{
ReSizeGLScene(LOWORD(lParam),HIWORD(lParam));
return 0;
}
}
return DefWindowProc(hWnd,uMsg,wParam,lParam);
}
int WINAPI WinMain( HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
MSG msg;
BOOL done=FALSE;
if (MessageBox(NULL,"Would You Like To Run In Fullscreen Mode?", "Start FullScreen?",MB_YESNO|MB_ICONQUESTION)==IDNO)
{
fullscreen=FALSE;
}
if (!CreateGLWindow("NeHe's Texture Mapping Tutorial",640,480,16,fullscreen))
{
return 0;
}
while(!done)
{
if (PeekMessage(&msg,NULL,0,0,PM_REMOVE))
{
if (msg.message==WM_QUIT)
{
done=TRUE;
}
else
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
else
{
if ((active && !DrawGLScene()) || keys[VK_ESCAPE])
{
done=TRUE;
}
else
{
SwapBuffers(hDC);
}
if (keys[VK_F1])
{
keys[VK_F1]=FALSE;
KillGLWindow();
fullscreen=!fullscreen;
// Recreate Our OpenGL Window
if (!CreateGLWindow("NeHe's Texture Mapping Tutorial",640,480,16,fullscreen))
{
return 0;
}
}
}
}
KillGLWindow();
return (msg.wParam);
}
==================================================================================================
I'm really confused now coz I'm a newbie for this
<div class="ForumMod">modified on Saturday, November 22, 2008 12:53 AM</div>
|
|
|
|
|
sen pao wrote: A comment would be a real help. Please try to compile and run the code to see what's going on.
While you may get lucky, it's doubtful that you'll get any takers on this. You need to narrow the problem down to a small handful of relevant lines and then start asking specific questions. As is it right now, most folks will just ignore this big bunch of code.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
I'm so sorry coz this is my first post. I just in hurry and then copy paste my problem to this thread. Please help me. I can't solve it.
|
|
|
|
|
Hi,
I am new to Visual C++/.Net, I have a simple question. I have a DatePickerTime object which I need to display future date in days (i.e. if you pick 11/21/2009, I will display 365 days).
I have managed to compute my 365 days but I am not able to assign the char* to the label Text
i.e. Sysytem::String ^
Can anyone help me? Thanks in advance
|
|
|
|
|
Label->Text = days->ToString();
By the way there is a separate forum for Managed C++.
-Saurabh
|
|
|
|
|
Thanks, but this does not work. I need to compute the numeric day toString() gives me 11/22/2009 but I need 365.
|
|
|
|
|
But you mentioned that you were able to compute the number of days from date time. You can also try Convert::ToInt32(str);
-Saurabh
|
|
|
|
|
Hi,
I recently upgraded several MFC projects at work from Visual Studio 2005 to 2008. However, when I distribute the recompiled executables with the new Studio 2008 DLL's, I'm getting the "configuration error" that always comes up when dlls/dependencies/manifests are wrong/missing. Looking at the binary, I see that two of my apps are depending on a previous version of MFC90.dll, but the MFC.manifest file is pointing to the latest version. I'm thinking that this is causing the error, but my question is, how do I get my apps to compile/depend on the same version of the dll that the manifest is pointing to?
Thanks!
KR
|
|
|
|
|
|
Hi,
My application serializes objects to disk but the files do not appear to contain the schema number - just my data. My class is derrived from CObject and uses the DECLARE_SERIAL and IMPLEMENT_SERIAL macros but the very first data member I serialise is a class which does not use the macros. Could this be the reason.
I need to add more data members to my class and the files that have already been written contain very important data so there is no possibility of me starting again.
Can anybody give me any advice what to do?
Thanks
|
|
|
|
|
You didn't use VERSIONABLE_SCHEMA or add your own versioning to
your serialization?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Could someone familiar with AVI please explain to me why I need to run a timer to execute AVI procedure callback?
In CView derived class I successfuky create (class.Create) AVI frame grabber ( in OnInitialUpdate). In Create I successfuky execute capSetCallbackOnFrame - passing callback procedure.
This procedure will not execute unless I set a timer during the frame creation.
( My is set to 1 ms.)
I have read the documentation and it does not say anything about any delay necessary after the capSetCallbackOnFrame is executed during the frame setup.
Thanks for reading.
Any constructive comments are appreciated.
Cheers Vaclav
Addendum:
It is getting even more confusing - the callback procedure runs after
capGrabFrameNoStop is executed - in my timer function.
I thought that capSetCallbackOnFrame does the "calling" of the callback procedure.
Back to reading documentation.
And the documetation saiz - there is a difference between CAPSTATUS and CAPTUREPARMS !
<div class="ForumMod">modified on Monday, November 24, 2008 11:35 AM</div>
|
|
|
|
|
If you are streaming, then the frame callback doesn't get called.
You need to use the stream callback instead.
You shouldn't need a timer - VFW will call your callback on its own thread(s).
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark,
I am making progrees but still have some dumb questions.
After I create the AVI frame I initialize the video driver, preview and get status.
In CAPSTATUS I see an entry fLiveWindow and I think I want it to be true, but default is false.
Is seems that "streaming" is burried in these CAPSTATUS variables.
But I cannot set the status and the documetation saiz that it is "dynamic".
I think I am missing the actual start of video capture but I can get the preview - one frame - just fine and get the callback to work when capGrabFrameNoStop is executed.
But accoring to the doc the callback shoul also work "directly" from preview.
Thanks for your help.
Vaclav
|
|
|
|
|
Hi everyone.
I've made a working thread that interact with a window by user-defined messages (WM_USER + x).
I would like use WPARAM and/or LPARAM to give to the window objects allocated in the working thread.
In few words, I would like obtain the same result that the Windows achieve with message like WM_CREATE (LPARAM is a pointer to a structure).
I know that the object I want pass through the message must be deallocated and I've tried to use the SendMessageCallback function, but the callback user-defined function is called only if GetMessage, PeekMessage or WaitMessage are called by the same thread (MSDN docet).
Anyone can help me?
Thanks a lot,
Sergio
|
|
|
|
|