|
First guess - the error is 'out of range', so is iIndex + 1 greater than the size of sValue, or is iPos greater than or equal to the number of elements ?
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Asking the same question again doesn't change the answer.
|
|
|
|
|
Hello,
How can i disable minimised, maximized and restore button
of my window. My requirement is to keep window and dialogBox
always in maximized position. And do not let user change its
size.
|
|
|
|
|
in the resource editor, specify the related dialog property... (right click the dialog title bar - for example - > Properties > check the right check box....)
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
You have to uncheck the 'System Menu' checkbox in the properties of your dialog (in the 'styles' tab).
If you use the MFC framework and if you have a SDI application, to remove these buttons on the main window, you need to add these lines at the end of InitInstance (from your App class):
m_pMainWnd->ModifyStyle(WS_SYSMENU, NULL);<br />
m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED);<br />
|
|
|
|
|
Hi,
I want to extract text content of MS-OFFICE documents(PPT,XLS....), programmatically.
THanks
MJValan
|
|
|
|
|
If requiring Office to be installed on target PC is OK, check COM.
Otherwise there are 3rd party suppliers for libraries reading various formats. Search for "xls text conversion" etc.
I can recommend wordcnv.com[^] for Word conversion, I have used it without problems.
Igor Green
http://www.grigsoft.com
Compare It! + Synchronize It! : Files and folders comparison never was easier!
|
|
|
|
|
|
|
Here is what I've coded for the task
case WM_MOVING:
{
LPRECT lprc = (LPRECT)lParam;
RECT WD;
GetWindowRect(hwndDlg,&WD);
WD.right -= WD.left;
WD.bottom -= WD.top;
RECT VDR;
SystemParametersInfo(SPI_GETWORKAREA,0,&VDR,0);
if(lprc->left <= VDR.left + 5 &&
lprc->left >= VDR.left - 5)
{
lprc->left = VDR.left;
lprc->right = lprc->left + WD.right;
}
if(lprc->top <= VDR.top + 5 &&
lprc->top >= VDR.top - 5)
{
lprc->top = VDR.top;
lprc->bottom = lprc->top + WD.bottom;
}
if(lprc->right >= VDR.right - 5 &&
lprc->right <= VDR.right + 5)
{
lprc->right = VDR.right;
lprc->left = lprc->right - WD.right;
}
if(lprc->bottom >= VDR.bottom - 5 &&
lprc->bottom <= VDR.bottom + 5)
{
lprc->bottom = VDR.bottom;
lprc->top = lprc->bottom - WD.bottom;
}
int HalfHeight = ((VDR.bottom - VDR.top) / 2) - (WD.bottom / 2);
int HalfWidth = ((VDR.right - VDR.left) / 2) - (WD.right / 2 );
if ((lprc->top >= HalfHeight - 5 && lprc->top <= HalfHeight) ||
(lprc->top <= HalfHeight + 5 && lprc->top >= HalfHeight))
{
lprc->top = HalfHeight;
lprc->bottom = lprc->top + WD.bottom;
}
if ((lprc->left >= HalfWidth - 5 && lprc->left <= HalfWidth) ||
(lprc->left <= HalfWidth + 5 && lprc->left >= HalfWidth))
{
lprc->left = HalfWidth;
lprc->right = lprc->left + WD.right;
}
return TRUE;
} break;
The only problem is after it's been snapped, when you move the mouse slowly away from the edge the window will stay put! Why does it do that?
I want it to mimic DVD Decrypter
Thank you.
|
|
|
|
|
The problem is that if the mouse moves slowly, you'll put it back where it was so that the user keeps having to drag it from the same spot. If they don't move enough, you'll keep snapping it back to where it was.
I think the easiest way (and I'm happy for someone to correct this) is to keep track of where the window and mouse cursor were when the operation was initiated (handle the WM_ENTERSIZEMOVE message) and calculate the full window position each time, rather than using the rectangle that was provided to you in the WM_MOVING message. Something like this:
In WM_ENTERSIZEMOVE:
- Get the window rectangle (GetWindowRect() ) - I'll call it oldWindowPos
- Get the mouse cursor position (GetMessagePos() ) - I'll call it oldCursorPos
In WM_MOVING:
- Get the current cursor position (GetMessagePos() ) - I'll call it newCursorPos
- newWindowPos.left = newCursorPos.x + (oldWindowPos.left - oldCursorPos.x)
- newWindowPos.right = newCursorPos.x + (oldWindowPos.right - oldCursorPos.x)
- newWindowPos.top = newCursorPos.y + (oldWindowPos.top - oldCursorPos.y)
- newWindowPos.bottom = newCursorPos.y + (oldWindowPos.bottom - oldCursorPos.y)
[edit]Forgot to mention that after this, you'd snap the window position [/edit]
Something like that, anyway
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
|
The office documents are OLE Compound Documents. You'll need to use the IPropertyStorage interface.
If you search for IPropertyStorage on Google and MSDN, you should find some examples.
Michael
CP Blog [^] Development Blog [^]
|
|
|
|
|
|
Hi, sorry if this is in the wrong forum.
Im working on a project in C++ using the GDI; with WinMain and all that.
For one bit of it, im using TextOut to display some text, but I also want to display an integer that will change. So TextOut will appear as follows:
<br />
int name;<br />
<br />
TextOut(hdc,x,y,"text",strlen("text");
"text" is technically an 'address of string to print'
How do I display the contents of name using TextOut?
Before using the stringstreams method is suggested, ive already tried that and my compiler isnt having it, and changing my compiler isnt an option.
|
|
|
|
|
Use sprintf() to write the integer to a string, or CString::Format() if you're using MFC.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Look Like you are using Win 32 api based Project.
Here is the way to display the content of name variable
int nName=4;
<font color=#00ff00>
char szBuffer[20];
<font color=#00ff00>
sprintf(szBuffer,"%d",nName);
<font color=#00ff00>
TextOut(hdc,x,y,szBuffer,strlen(szBuffer));
or in place of sprintf you can use itoa() too (which convert interger to string)
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
hy alok,
use the delete button when post post the same message twice.
secondly, use #008000 green's color instead of your #00FF00
see you
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Thanks,
I have deleted that post, that's really very-2 silly mistake .
"I Think this Will Help"
<h5
alok="" gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
Is there is any way to hide the DOS window that
shows when system command is executed.
system("Dir/ar>File.txt");
lists the readonly files to the file.txt.
Is it possible to use ShellExecute ?.if so what is the syntax?.I tried using cmd.exe with shellexecute but
seems that cmd.exe doesnt takes parameter.
|
|
|
|
|
Why not use FindFirstFile() and FindNextFile() instead of the antiquated system() call? You'll be much better off.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I have a proyect based on Chatsrv/chatter samples on Visual C++ 6.0. My surprise comes from the fact that the same proyect compiled on Visual C++.NET fails when receiving data for a short time. That is, for some time, I get the data through the socket but suddenly and with no exception catched, I give up receiving data . Just in case it can turn out to be a clue, this communication is unidirectional, that is, I get the data from a monitor connection to a certain port.
|
|
|
|
|
Hi:
Please some help about fuzzy set.
or any site tech such techinques
any help can help me .
Thanx alot.
Bye
On Earth nothing impossible,
while your mind running.
Faroqtam
|
|
|
|
|
If your 'set' is too fuzzy, shave 'em. Just try not to hurt yourself.
If that's not what you mean, try to explain yourself a little better.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Christian Graus wrote:
If your 'set' is too fuzzy, shave 'em. Just try not to hurt yourself
Haven't you ever heard of fuzzy set theory?
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|