|
I don't think you can achieve this through registry modification. Do you know the key/value in registry to modify??
ARSALAN MALIK
|
|
|
|
|
To tell the truth... I don't know which key/value in registry to modify.
Then I've been looking into various information, but I can't find!
As the result, the way is not registry modification but another one.
Then do you know the www link(s) or any tip(s) to solve?
|
|
|
|
|
you can remove "print", but not "cut" or "copy" via registry!
Don't try it, just do it!
|
|
|
|
|
I see...
Then is the way to solve something special or dangerous?
As the lack of information, now I'm really at a loss...
I'd like to know the way by all means!
|
|
|
|
|
hi everyone
i got a little problem.
i'm trying to build a dll which opens a file to read ellipsoid parameters. these parameters are double values.
i found out, that i get a run time error when using "sscanf" in
a dll.
but what is the solution? how can i get doubles from a string in a dll?
live fast, die young!
|
|
|
|
|
Did you try atof ?
Regards,
Alexandru Savescu
|
|
|
|
|
If you are reading file in dll, then why are you not using fscanf ?
ARSALAN MALIK
|
|
|
|
|
thanx to both of you.
i tried both and it all works fine.
live fast, die young!
|
|
|
|
|
I need to MINIMIZE my app when the app start how can I do that?
|
|
|
|
|
If you are using SDI or MDI app, go to InitInstance method of CWinApp, look for pMainFrame->ShowWindow , change parameter to SW_SHOWMINIMIZED .
ARSALAN MALIK
|
|
|
|
|
One way is to call ShowWindow using SW_MINIMIZE
or add the WS_MINIMIZE style to your CreateWindow call.
Searching for either of these terms on MSDN or Google will provide examples.
Michael
CP Blog [^]
|
|
|
|
|
|
Hello friends,
I want to search all the file present in a particular directory which can be set at run time with a specified extension. For example, I want to search all the file name of extension with .bmp at the path c:\windows. The path C:\windows can be changed to C:\my documents\ at run time depending on the situation. how can i achieve it?
Thank you,
Neelesh Jain.
|
|
|
|
|
Use FindFirstFile and then FindNextFile to enumerate all files. Pass "c:\\documents\\*.bmp" as lpFileName.
ARSALAN MALIK
|
|
|
|
|
To Hello,
With VC 6.0 ActiveX ControlWiizard, the code below was written.
BEGIN_PROPPAGEIDS(CSmileCtrl, 2)
PROPPAGEID(CSmilePropPage::guid)
PROPPAGEID(CLSID_CColorPropPage)
END_PROPPAGEIDS(CSmileCtrl)
On my property page I have only 2 tabs: General and Extended.
Should I have 3 tabs with: General, Color and Extended?
The documentation said that the MFC DLL was not installed properly. Found nothing wrong with the installation.
Please advise.
Thanks.
S1189216G
|
|
|
|
|
Hi,
In my module, the port should be enable which r found in the system.
For example if the sysytem has port1 & port2.
Then they should be enabled in my menu bar.
How is it possible?
PLs help.
mithila
|
|
|
|
|
|
Hello friends,
Here again with another question.
I want to display 4 different images in a single row in a list control. If more number of images are to be displayed then they should be displayed in next row and each image should selected on a click of a mouse button for example "THE THUMBNAILS VIEW" in windows explorer.
Bye bye
thank you
|
|
|
|
|
I want to encrypt the strings in my program (the ones your can read in the exe), so I need to find an easy to use, small, and fast decrypt function. I want something secure too, do you know of any tutorials or source code?
Thanks.
Oh I will encrypt my strings before hand so it does'nt matter if the encryption function is slow or a memory hog
wWw.KruncherInc.cOm
|
|
|
|
|
|
what do you need this for? to prevent crackers from hacking your software? then this way will be very ineffective. they will scan the memory for the decrypted version.
Don't try it, just do it!
|
|
|
|
|
Hi,
I am tryiny to develop a UNICODE version of my application with VC++6.0 under Chinese OS, the CHINESE CHARACTERS that I entered for the COMBOBOX control by its property tab(DATA) could not be displayed correctly under English OS? The other components such as static and button were OK. When I opened the rc file with Notepad, I foud that the other components were written in Chinese, however, the COMBOBOX was written in digital code such as 0x545f.
Does anyone know how to solve this problem?
THANKS!
Robert
REF:
IDD_TESTH_DIALOG DIALOGEX 0, 0, 320, 200
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW
CAPTION "TESTH"
FONT 9, "Tahoma"
BEGIN
DEFPUSHBUTTON "确定",IDOK,260,7,50,14
PUSHBUTTON "取消",IDCANCEL,260,23,50,14
LTEXT "TODO: 在这里设置对话控制。",IDC_STATIC,50,106,200,8
COMBOBOX IDC_COMBO1,98,53,177,89,CBS_DROPDOWN | CBS_SORT |
WS_VSCROLL | WS_TABSTOP
EDITTEXT IDC_EDIT1,26,77,40,14,ES_AUTOHSCROLL
COMBOBOX IDC_COMBO2,187,86,48,56,CBS_DROPDOWN | CBS_SORT |
WS_VSCROLL | WS_TABSTOP
END
....
IDD_TESTH_DIALOG DLGINIT
BEGIN
IDC_COMBO1, 0x403, 7, 0
0x545f, 0xca28, 0x29c7, "\000"
IDC_COMBO1, 0x403, 3, 0
0xf1b7, "\000"
IDC_COMBO2, 0x403, 3, 0
0xc7ca, "\000"
IDC_COMBO2, 0x403, 3, 0
0xf1b7, "\000"
IDC_COMBO2, 0x403, 3, 0
0xd0d6, "\000"
0
END
aa
|
|
|
|
|
hi i have this program to do and i am kind of sttucked on the keyboard action
can someone wrote for me the KeyboardFunc with a switch statment and this is the program
a program that allows the user to enter and edit pictures made up of as many as
60 polylines. The user interacts with the screen by pressing the keyboard keys and
pointing and clicking the mouse. The functionality of the program should include the
following “actions”:
Begin (‘b’) – create a new polyline
Delete (‘d’) – delete the next point pointed to
Move (‘m’) – drag the point pointed to to a new location
Insert (‘i’) – insert a new point in the polyline
Refresh (‘r’) – erase the screen and allow user to start from sctrach
Quit (‘q’) – exit from the program
A list of polylines can be maintained in an array such as GlintPointArray polys[60].
The verb begin, activated by pressing the ‘b’ key permits the user to create a new
polyline, which is stored in the first available ‘slot’ in array polys.
The verb delete requires that the program identify which point of the polyline lies
closest to the point currently designated by the mouse. Once that point is identified,
the “previous” and “next” vertices in the chosen polyline are found. The two line
segments connect to the chosen vertex are erased, and the previous and next vertices
are joined with a line segment.
The verb move finds the vertex closest to the currently designated point and waits for
the user to click the mouse a second time, at which point the vertex is moved to the
new point. EQUAL marks will be allocated if you allow the user to click and drag the
point interactively!
Your program should also allow the user to read in a file containing a list of polylines
into an array and allow the user to manipulate these points.
and this is the mouse function
#include <windows.h>
#include <gl gl.h="">
#include <gl glu.h="">
#include <glut.h>
const int screenHeight=480;
class GLintPoint{
public:
GLint x,y;
};
void myInit(void)
{
glClearColor(0.0,1.0,1.0,0.0);
glColor3f(1.0,0.0f,1.0f);
glPointSize(9.0);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(0.0,440.0,0.0,480.0);
}
void myMovedMouse(int mouseX, int mouseY)
{
GLint x = mouseX; //grab the mouse position
GLint y = screenHeight - mouseY; // flip it as usual
GLint brushSize = 5;
glRecti(x,y, x + brushSize, y + brushSize);
glFlush();
}
void myMouse(int abutton, int state, int x, int y)
{
static GLintPoint points[3];
static int numPoints = 0; // initial value is 0
if(abutton == GLUT_LEFT_BUTTON && state == GLUT_DOWN)
{
points[numPoints].x = x;
points[numPoints].y = screenHeight - y; // flip y coordinate
numPoints++; // have another point
if(numPoints == 3)
{
glBegin(GL_POLYGON);
glVertex2i(points[0].x, points[0].y);
glVertex2i(points[1].x, points[1].y);
glVertex2i(points[2].x, points[2].y);
glEnd();
//Recti(corner[0].x, corner[0].y, corner[1].x, corner[1].y);
numPoints = 0; // back to 0 corners
}
}
else if(abutton == GLUT_RIGHT_BUTTON && state == GLUT_DOWN)
glClear(GL_COLOR_BUFFER_BIT); // clear the window
glFlush();
}
void myDisplay(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glFlush();
}
void main(int argc, char **argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize(480, 480);
glutInitWindowPosition(100, 150);
glutCreateWindow("my first attempt");
glutDisplayFunc(myDisplay);
glutMouseFunc(myMouse);
glutMotionFunc(myMovedMouse);
myInit();
glutMainLoop();
}
|
|
|
|
|
Hello all, I am getting a segmentation fault when trying to access an array... I know this is silly, am I overlooking something? What the hell? The problem seems to occur when accessing an array from the bigFish function. Please teach me..
#include <iostream>
#include <iomanip>
#include <fstream>
#include <string>
using namespace std;
struct fish{
int contestant[99999];
int fishNumber[99999];
float fishWeight[99999];};
void readFiles(int contest[20], string name[20], int fishNum[5],
string fishType[5], fish fishStruct);
void bigFish(int contest[20], string name[20], int fishNum[5],
string fishType[5], fish fishStruct);
int main()
{
fish fishStruct;
int choice = 0; //choice in menu
cout.setf(ios::fixed, ios::floatfield);
cout.setf(ios::showpoint);
cout.precision(2);
int contest[20];
string name[20];
int fishNum[5];
string fishType[5];
readFiles(contest, name, fishNum, fishType, fishStruct);
cout<<"MENU: PLEASE MAKE A SELECTION"<<endl<<endl;
cout<<"1.="" display="" all="" data="" for="" a="" contestant"<<endl;
="" cout<<"2.="" total="" catch="" weight="" fish="" type"<<endl;
="" cout<<"3.="" largest="" caught"<<endl<<endl;
="" cout<<"choose="" and="" option="" between="" 1-3"<<endl;
="" cin="">>choice;
if (choice == 3)
bigFish(contest, name, fishNum, fishType, fishStruct);
return 0;
}
void readFiles(int contest[20], string name[20], int fishNum[5], string fishType[5], fish fishStruct)
{
ifstream inFile;
inFile.open("contestantname.data");
if (!inFile)
{
cout<<"contestantname.data not found"<<endl;
}
="" clearing="" out="" the="" array
="" for(int="" i="0;" <="" 20;="" i++)
="" {
="" contest[i]="0;
" name[i]=" " ;
="" int="" count1="0;
" while(infile)
="" infile="">>contest[count1];
inFile>>name[count1];
cout<<name[count1]<<endl;
count1++;
="" }
="" infile.close();
=""
="" infile.open("fishtype.data");
="" if="" (!infile)
="" {
="" cout<<"fishtype.data="" not="" found"<<endl;
="" clearing="" out="" the="" array
="" for(int="" i="0;" <="" 20;="" i++)
="" fishnum[i]="0;
" int="" count2="0;
" while(infile)
="" infile="">>fishNum[count2];
inFile>>fishType[count2];
count2++;
}
inFile.close();
inFile.open("catch.data");
if (!inFile)
{
cout<<"catch.data not found"<<endl;
}
="" clearing="" out="" the="" array
="" for(int="" i="0;" <="" 20;="" i++)
="" {
="" fishstruct.contestant[i]="0;
" fishstruct.fishnumber[i]="0;
" fishstruct.fishweight[i]="0;
" int="" count3="0;
" while(infile)
="" infile="">>fishStruct.contestant[count3];
inFile>>fishStruct.fishNumber[count3];
inFile>>fishStruct.fishWeight[count3];
count3++;
}
inFile.close();
}
void bigFish(int contest[20], string name[20], int fishNum[5],
string fishType[5], fish fishStruct)
{
int num = 0; //temp contestant number
int totalWeight = 0; //weight for each contestant
string tempName; //temp contestant name
cout<<"Please enter contestant number"<<endl;
cin="">>num;
for(int i = 0; i < 20; i++)
{
cout<
|
|
|
|
|
In the bigFish function, instead of passing the entire arrays as parameters, pass the address of the first cell (&name[0], for example, and function parameter is string*). All other code in this function can remain unchanged.
As the 'name' parameter is of type 'string', have you made sure that the 'string' class supports the << operator ? If it doesn't, the std::cout will cause serious problems.
Also, the program wastes huge amounts of stack memory with those 99999 slot arrays. Most obviously the process runs out of memory, thus causing a segmentation fault. This is because you have large arrays of integers that are static. They consume the stack memory of the process, which is limited, and will quickly run out.
If you do not know what dynamic memory allocation is about, you should go grab a good C++ book from the local library and read it through with thought. Dynamic memory allocation is one of the key concepts of efficient programming.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|