|
Is it possible to check if you are about to download something from the internet?
|
|
|
|
|
Check here, here, and here.
It's possible that no ones knows a solution to your problem (at least on this board).
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Is there an easy way to compare two unicode strings that isn't case sensative. That is "fIlEnAmE" and "FiLeNaMe" should be considered the same?
My program presents writes a level 3 ISO9660 file system. Windows is unable to deal with this correctly. (I seem to be the only one actually writing level 3 ISO9660) Thus I need to read it myself. This works just fine in normal ISO9660, but as soon as I add joliet extentions I have to change to unicode, and there I am case preserving. (as joliet requires) However windows is not case sensative, and there I'm not sure what to do.
The easy solution is to convert to ASCII, which is easy to convert to upper case, but that won't work for anything other than latin derived languages (I wouldn't be surprized if some of them had special case that didn't work), with unicode I'm already close to supporting other languages correctly, I'd like to go the rest of the way if I can.
Thus the question, can I access whatever function windows uses to convert case, in unicode?
|
|
|
|
|
I ran into something liek this for some code I had to write for my project, the VCF.
int Win32LocalePeer::collateCaseInsensitive( const UnicodeString& s1, const UnicodeString& s2 )
{
int result = 0;
if ( System::isUnicodeEnabled() ) {
result = ::CompareStringW( lcid_, NORM_IGNORECASE, s1.c_str(), s1.size(), s2.c_str(), s2.size() );
}
else {
AnsiString tmp1 = s1;
AnsiString tmp2 = s2;
result = ::CompareStringA( lcid_, NORM_IGNORECASE, tmp1.c_str(), tmp1.size(), tmp2.c_str(), tmp2.size() );
}
return result;
}
DOn't know if this is exactly what you want but here's hoping!
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
lcid_ is a member value that is a valid LCID for the locale you want.
UnicodeString is just a wrapper around std::basic_string<wchar_t>.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
Thank you. I knew there had to be an easy way, but I didn't find it when I searched. (I didn't search the right places to find it)
I don't know that it works, but if it doesn't the bugs are mine now...
|
|
|
|
|
Hi
Just a quickie - how secure is sending a file over a named pipe? I'm not bothered that fussed about delivery guarantee, but want to be sure nobody else can intercept the message on the way, or modify it before it gets there.
Hope this makes sense.
Regards
Malc
The sooner you fall behind, the longer you have to catch up
|
|
|
|
|
I say no. Messages can be intercepted. For secure data transfer, check out socket using SSL.
Kuphryn
|
|
|
|
|
How can I empy all information that I have in my List controll?
This is what I have try to to.
i=m_List.GetCount();
for(int l=0; l
|
|
|
|
|
|
I've got quite weird problem. From the main dialog I create a modal dialog where I make some computations and display results using OpenGL. I set Timer and when I get WM_TIMER message I redraw this dialog's window using RedrawWindow(). The problem is one time I create this dialog it works fine from the begining to the end. But when I try to do it again it doesn't get visually redrawn at all. I've placed different checks in my code. They have shown that in this dialog's lifecycle OnPaint func succesfully gets entered numerous times where I perform all the drawing. But I don't see any result. The problem arises on Win9x only. In 2k/XP everything goes perfect. Note that I don't only test it on Win9x but compile it's own variant too. So I need your help.
|
|
|
|
|
Invalidate() (optionally followed by UpdateWindow() if you want the redraw to happen immediately) should cause a repaint.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
It still doesn't work. Here's a scheme:
// Main.cpp
void CMainDialog::On_Visualize() // Create a modal dialog
{
...
OpenGL_Dialog my_gl;
my_gl.DoModal();
...
}
// OpenGL_Dialog.cpp
BOOL OpenGL_Dialog::OnInitDialog() // Setting timer when creating dialog
{
CDialog::OnInitDialog();
...
draw_counter=0;
SetTimer(1,10,NULL);
}
void OpenGL_Dialog::OnDestroy() // Kill timer when destroying
{
...
KillTimer(1);
CDialog OnDestroy();
}
void OpenGL_Dialog::OnPaint()
{
draw_counter++; // check
CPaintDC dc(this);
DrawGLScene2D;
SwapBuffers(m_hgldc);
}
void OpenGL_Dialog::OnTimer(UINT nIDEvent)
{
switch(nIDEvent)
{
case 1:
RedrawWindow();
break;
...
}
CDialog::OnTimer(nIDEvent);
}
void OpenGL_Dialog::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
switch (nChar)
{
case 32:
char buf[10];
itoa(draw_counter,buf,10);
AfxMessageBox(buf);
break;
...
}
CDialog::OnKeyDown(nChar, nRepCnt, nFlags);
}
Something like this. I wouldn't actually have placed drawing handling on timer but I need to respond to user input and other stuff. So striking space during the dialog's lifecycle I get the number of redrawings and this number is growing all the time. But in most cases the screen stays blank and nothing is drawn.
|
|
|
|
|
Replace RedrawWindow() with Invalidate() . Add a TRACE() statement just before the call to Invalidate() to ensure the case is executing.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
When I insert VB ActiveX into a form (in VC++ for example) I have a problem with message boxes, which pop up when some event occurs. But my message boxes are not modal (I set vbApplicationModal). What do I have to do ?
|
|
|
|
|
Search for the following items:
WM_DROPFILES
DragAcceptFiles()
DragQueryFile()
MSDN Article titled "Transferring Shell Objects with Drag-and-Drop and the Clipboard"
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
When one creates a drop down menu using the resource editor, it is possible to specify that a menu item is "checked", allowing one to have a check mark appear (or not) on the item when the menu is dropped down.
I would like a tri-state check mark. The check mark is either present, not present, or "greyed".
If I call pCmdUI->SetCheck(2), where pCmdUI is the CCmdUI* pointer passed to the "UI Update method", it causes the check mark to be drawn just as passing the value 1 would. The documentation indicates that the value 2 indicates an indeterminate state (the tristate).
Do I need to somehow intercept the menu being activated, and then change some kind of style mask on the menu items?
Any suggestions or example code would be appreciated.
Thanks
|
|
|
|
|
Hi
Is there any method of drawing circles and points with float values.
I am drawing a series of circles and points on my view. (A scientific application)
I am using SetPixel and Ellipse methods to draw point and circles respectively.
Every thing is working fine, but to the application context when we analyse further that series of holes have to be closer i.e. at one end all holes circumference must overlap and just give a shape like all circles are connected at that point.
Circles are generally one inside other. i.e. bigger outside and then smaller inside.
But it instead of showing holes closer it shows them somewhat wider.
I thought this might be due to holes i am plotting with int values.
Thats why this thought that if holes drawn with float to check whetehr it corrects the problem i am facing.
Sandeep
Leave your mark wherever you go
|
|
|
|
|
Is there a simple way intercept all keyboard messages sent to buttons in my dialog and process them myself? I really don't want any keyboard input in my dialog, and I want the dialog to be able to recieve arrow key presses. Is there a simple way to do this without subclassing each control?
Joel Holdsworth
|
|
|
|
|
Have you looked at OnSysKeyDown() , OnKeyDown() , and OnChar() ?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Yes... Problem is that when my dialog controls have the focus, then they seem to eat all the keyboard messages!
Joel Holdsworth
|
|
|
|
|
I got a simple DOS app. primary school slash hello world slash newb kind of app.
So the thing is, an ofstream opens a file then writes a string, just a word derived from user thru cin >> word; then closes it.
Now I need this file to be reopened later in the loop and writen to again while preserving the old data. Tried outFile.open("filename", ios::ate) to force the file pointer to the eof, but can't make work. I am prety sure that is wrong anyhow.
What is the right way to do it?
Oh, by the way, there must be a way to keep user inputs in some sort of list inside the program code without rellying on ofstreams. Can someone tell me what parts of C++ handles that sort of stuff, just a name would be OK.
Thanks for reading this long ass post!
|
|
|
|
|
How can I view a file with an external viewer from within my application? I know I could use the "system" command, but then I have to give the path to the external viewer, but what when I don't know the path? I mean if my application needs to view a html page I could give a path to netscape or IE, but what if there is not one of them at the system because the user only installed opera? Is there a quick and easy way to access the windows default viewer for the different fileformats? You know if you doubleclick on a file windows starts an application for viewing or editing that fileformat. Is there a command to do that easiely in a VC++ project?
|
|
|
|
|
Have a read of ShellExecute on MSDN. Or do a google for some examples.
Michael
CP Blog [^]
|
|
|
|
|
Thanks a lot! I managed to solve my problem.
|
|
|
|