|
Thanks for the suggestion. I used the SetWindowLong() function to disable the autosize feature of the toolbar, then resized it to 0, all seems to work, until I want to restore it. I reset the Styles, reset the size, and call for an update. The toolbar appears, minus the buttons??? I thought this would be a simple task so I left6 it till the last, guess I was wrong!
|
|
|
|
|
Currently i have a structure of
struct data
{
long int addNumber,addPostal,exMth,exYear;
char fName[40],lsName[40],addStreet[40],addCity[40],addState[40];
};
data dataRecords[100];
This is used to store values in dataRecords[0],dataRecords[1], etc...
In using this method, I can only store up to a max of 0-100 records. Is there anyway where number of dataRecords can be made dynamic? instead of limiting it to 100. There is another method of using linked list instead, but i dun have enuff time to change my whole program to adapt to it.
Thanks
|
|
|
|
|
The best way to deal with dynamic arrays is using the vector class from the standard template library.
Another way is yo use dynamic arrays (by using new[] and delete[]) but then you have to manage the memory yourself.
|
|
|
|
|
Using the STL vector class is probably the best way to go. And while you're at it you may save a bit of space using the STL string class too.
|
|
|
|
|
|
Hello everyone,
I always notice that some guys are using some VC built-in variables to specify some properties, like OutDir, ProjectName, SolutionName, etc. Then we can use the built-in variables to specify, for example, the generated library name, like $(OutDir)/$(ProjectName).lib.
I think this way is very convenient compared with hardcoded names. I am wondering where can I find a list of all such built-in variable names and meanings?
thanks in advance,
George
|
|
|
|
|
In VS.NET 2003, go to Project Properties, Build Events, Post-Build Event, click in the Command Line box, then click the [...] button that appears at the end of the field. Then click the [Macros>>] button to expand this dialog. This lists all the macros valid for use in this project.
|
|
|
|
|
Cool way, Mike!
I could also see the values as well.
regards,
George
|
|
|
|
|
Using Visual C++ 6 in Visual Studio 6
I need a c++ function to find particular patterns in single word strings and remove them from the string. These patterns are either always at the right of the string or at the left of the string, never in the middle. I have over 300,000 patterns to search for, currently stored in an Excel table. An example is as follows:
I give the function “recyclable” and the pattern “able” is removed, thus returning “recycl”. The spelling error is irrelevant. If you take another example, “recycling” and the function removes “ing” thus again returning “recycl” you can see where I am coming from. Both words, “recyclable” and “recycling” return the same result. This is what I want.
As I said, I have over 300,000 of these patterns that need to be searched for and removed. All values have been converted to lower case.
Here is an example of how I am currently doing this in Filemaker Pro, in plain English using the word “photographer”
I feed the word “photographer” to the variable X. “er” exists as a right value in my table, and because X is longer than 2, “er” is removed. The length needs to always be bigger than the table value, or X might be set to empty. If you consider that my table contains the right values “er” “ic” “y” etc. than you will see that the following results can be obtained:
photographer = photograph
photography = photograph
photographic = photograph
And so on.
I am not a C++ programmer. I need to know how to reference a table of values in c++ (what form should the table be?) I presume Excel is not correct. I need to know how to compare my input with the table (i.e. find “able” only if the 4 right-most characters of my input match. If I’m finding on the 4 right-most characters then the function should only be performed if my input is longer than 4.
I guess this system is a little like a spell check system with auto correction. If you look at the Auto correction (not the spell check) from Microsoft Word, for example, this is exactly what I am looking for, except that the correction is only based on part of the string, and will simply remove it.
I know you cannot solve this problem for me, but perhaps you can set me in the right direction. For example, what table format should I use? How do I reference this table in C++. How do I compare parts of strings with a table (database) of values.
Any help at all would be fantastic. I know this is a big job for someone who has never used c++ before, but I am determined to do it!
Rigsby
|
|
|
|
|
Dear all
I write one dll in VC++ 6 IDE that is used in borland C++ builder environment.
I use the _pgmptr to get the execution path. but if we use the dll in builder IDE then the _pgmptr returns NULL.
would you please inform me another possible routines to get execution path.
Regards
Mahdi
|
|
|
|
|
Interesting, I'd not come across that before.
The best way to get the full path to the executable running in the process is to use GetModuleFileName . Pass NULL for hModule to get the executable's path, or the hInstance value passed to your DLL's DllMain to get that DLL's path.
Looking at the C run-time source code (in STDARGV.C), I see that _pgmptr is actually initialised from the result of GetModuleFileName . This code is called from mainCRTStartup and the corresponding routines for Unicode and Windows GUI EXEs, but isn't called for a DLL (it wouldn't make sense).
|
|
|
|
|
tanx alot
|
|
|
|
|
Hi all,
I am in a task of printing something using my VC++ Programme.
In Print Preview I am getting my page in Portrait Orientation.
But I want to change it into LandSpace using my VC++ Programme.
How can I Achieve it .
Thanks in Advance.
Yours Faithfully
George K Jolly
|
|
|
|
|
|
Did you see DEVMODE and DMORIENT_LANDSCAPE/DMORIENT_PORTRAIT
|
|
|
|
|
I'm trying to write a C++ .NET program that will move an image very quickly across the screen. Maybe all the way across in one second. What would be the easiest way to do this? All the timer functions perform incorrectly at intervals small enough to do what I want, so i'm looking for a different solution. Will GDI+ do it, or do I have to move to DirectX? I'm looking for something simple, hopefully, but that wont be excessively choppy... only moving at about 2-3 pixels at a time hopefully, so the interval would have to be around 4-5 milliseconds. Again, timer functions dont work correctly at intervals this small.......... thanks for the help!
|
|
|
|
|
Firstly I'd suggest bypassing the whole problem by using an .AVI animation and the Animation common control. If that doesn't work for you, I'd suggest looking into the multimedia timers[^].
|
|
|
|
|
Hi,
I am new to VC++, i am trying a win32 application in which i need to know the position on the screen where the user is typing. I need to know the X and Y screen co-ordinates, where the characters being typed shows up.
We can know the key pressed with the help of Windows hooks, but don't know how we get the position where it shows up.
Can we know the keyboard cursor blinking position on the screen?
Please help me on this.
Thanks in Advance.
|
|
|
|
|
CWnd::GetCaretPos
-- modified at 10:41 Sunday 20th August, 2006
oops, you said Win32. that would be
::GetCaretPos
|
|
|
|
|
Hi,
Thank you for your help. I tried with the below sample code
to understand "getCaretPos", but i am always getting the output
always as " 0 0 "
POINT *ptemp = new POINT;
while(1)
{
if(!GetCaretPos(ptemp))
printf("ERRORRRRRRRRRR \r\n");
printf("%d %d", ptemp->x, ptemp->y);
Sleep(500);
}
Am i missing anything?
please help.
Thank you
|
|
|
|
|
|
I had this working perfectly before, but now it's all screwed up, even after doing a clean-build.
I have 2 icons in my resources
<br />
#define IDI_ICON1 301<br />
#define IDI_ICON2 302
The first problem is I want the main icon for the exe to be ICON1, at the moment it's ICON2 and refuses to change. The taskbar icon is ICON1, no problems there. The title bar is the default WIN32 icon. I use the following code to change this but still my icon is not being displayed.
dw = GetClassLong(hDlg,GCL_HICONSM);
HANDLE icon = LoadImage(hInstance,MAKEINTRESOURCE(IDI_ICON1),IMAGE_ICON,16,16,LR_DEFAULTSIZE);
dw = SetClassLong(hDlg,GCL_HICONSM,(LONG) icon);
dw = GetClassLong(hDlg,GCL_HICONSM);
dw = GetLastError();
According to the code, the icon was set, but it refuses to display.
|
|
|
|
|
|
I have a project and must to control the WM_CLOSE message in MDI sub window, and must capture it and judge If can close the frame How to do it thanks
I have a project and must to control the WM_CLOSE message in MDI sub window, and must capture it and judge If can close the frame How to do it thanks
|
|
|
|
|
assuming you have an MFC app, look at overriding the CDocument::CanCloseFrame() method
cje
|
|
|
|
|