|
i have an SDI Application with a single view and i need to create new view, that would be a tool modeless window. what should i do?
|
|
|
|
|
An easy solution would be a simple dialog box. Another solution is to create a new window and then show and/or hide it.
Kuphryn
|
|
|
|
|
Is there a way of checking what versions of controls I am using in my application so I know what to distribute? I selected controls from the toolbox but am not sure which ones they are on my hard disk.
Hopefully, there is something like depends.exe which shows you the control name, location, version, etc. for everything your application is using.
Meanwhile, I have been looking up the CLSIDs in the header file and searching the registry and using OLE/COM object viewer to correlate the files needed.
The reason I'm asking is that even though I have packaged the rich text control, Richtx32.OCX, into my installation program and have registered the control, I am still having problems with my application's release build -- the rich edit control is not visible. I am running Windows 2000 and have tried running the program on Win98 and NT4 but no success.
Are there any other files I need with the richtext control, the flexgrid control, and the tab control besides their OCX counterparts? BTW, I'm a little confused here, I thought I selected a rich edit control (Edit box) into my form view but the CLSID is coming up with RichTx32.ocx.
|
|
|
|
|
Have you called AfxInitRichEdit at the beginning of your app?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Yes. Thank you. I've gotten further.
Does anyone know if there are some incompatabilities or limitations with the tab control, flex grid control, or rich text control with Win98 or other OS's???
|
|
|
|
|
I think my question was answered today. Someone asked about some problem he/she was having with the MSFlexgrid control and somebody responded that he needed a runtime license for it.
|
|
|
|
|
Hi,
I am trying to use ADO and ADOX, and I have included the following #import statements in the stdafx.h file,
#pragma warning(push)
#pragma warning(disable:4146)
#import "C:\Program Files\Common Files\System\ADO\MSADO15.dll" \
rename ("EOF", "EndOfFile")
#import "C:\Program Files\Common Files\System\ADO\msadox.dll"
#pragma warning(pop)
But, when I use the various objects in both the ADO and ADOX package, I need specify ADODB:: and ADOX:: respectively. If I do not specify this then it gives me an error saying that the class is not defined. Can Some one let me know why I am getting such an error.
Thanks,
Arthi
|
|
|
|
|
Having to prefix the names from these libraries is not a bad thing per se, but if you want to get rid of this obligation, include the following just after the the imports:
using namespace ADODB;
using namespace ADOX; This will pose problems if there are coincident names in the libraries: in those cases, you will have to include the prefix anyway.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
|
http://www.codeproject.com/shell/ShellExtGuide1/ShellExtGuide1_demo.zip
This is its demo project.
Aint there the code u wanna add somewhere in this demo??
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
yep, but the demo project don't work on my pc...
but I'll look anyway, was hoping for the quick way out!
|
|
|
|
|
I remember in visual basic there was a function for formatting numbers which seperated the number 1763836382 to 1,763,836,382 or 1.763.836.382 depending on the system settings. is there a function that will do that in c++, or is there just a function that will seperate them with a specified character? (i was thinking sprintf but couldn't find that specific flag for digit grouping)
Thanks in advance.
-Rune Svendsen
|
|
|
|
|
Take a look at the GetNumberFormat in the MSDN. Here's a quote:
"The GetNumberFormat function formats a number string as a number string customized for a specified locale."
So you can use regular sprintf to format the number as a string, and then format that string to the specified locale.
Chris Richardson
|
|
|
|
|
I have a Dialog application with a CTReeCtrl in it . I am buiding an Object Model using the Tree Ctrl but have an XML string associated with each node in the TreeCtrl . I can generate an XML file by traversing all the nodes in the Object Model(TreeCtrl) and just printing the associated Text for a node into a file .
I need to embedd the text information with each node in the TreeCtrl ?
How should I be going about this .
One option is that
For each node in the TreeCtrl i can generate an entry in a look up table that also contains associated text(data). This can be done by generating unique data for each node and by using the SetItemData method for a TreeView Ctrl .
I want to know if there is a better way of doing this !
Please help ( ( confused:
|
|
|
|
|
SetItemData() seems the natural way to go, since you want to associate app specific data with each tree node.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
|
I'm having a problem assinging discontinuous ranges to chart series.
For example the following code works if Xvaluesrange and valuesrange are continuous ranges but not if they are discontinuous:
ActiveChart.SeriesCollection(1).Xvalues = Xvaluesrange
ActiveChart.SeriesCollection(1).values = Yvaluesrange
This gives a "run-time error '1004' Unable to set the Xvalue of the Series class".
From the Excel interface it is possible to assign discontinuous ranges to chart series.
I think this is happening because the Xvalues and Yvalues properties are expecting arrays of values.
If the range I am providing is contiguous, Excel can convert it to an array of values on the fly.
I need to link the data series to the cells. I cannot use constant values neither in Xvaluesrange or YValuesrange.
I cannot use SetSourceData method because it doesn't preserve the existing chart series.
How can I assign discontinuous ranges to new chart series.
Thanks in advance,
Jose.
|
|
|
|
|
Hi
currently I'm developing an app that queries a lot of game servers at a time using UDP. I have a list of about 1000 servers and want to get their information, that's why I need to call SendTo() for every server. If I receive an answer from the server I want to add all necessary information into a CListCtrl .
What's the fastest and safest way to do that? Furthermore I want to set a timeout value (say 1500ms). If the server doesn't answer in that time I want to skip the request and go on with the next server. Currently my code is very crappy and doesn't work very well, i.e. is crashes after about 20 servers (I do not use threads).
I want it that way:
for(int i=0; i<ServerCount; i++)
{
socket.SendTo(...);
(...wait 1500msec for answer)
(next server...)
}
I have overridden my own CSocket so that a member function OnReceiveUDP is called whenever there is data that can be received.
Any suggestions?
Thanks in advance
Greg
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I'm having problems with the window generation of the following code on a Win9x system.
The window is a "child" window that contain a menu and is allowed to be anywhere on the screen, it's not contain
by the parent window. On a win9x system when the window first appears the menu is present but can not be
activated. It seems that is is just drawn and thats it. If I force a redraw the menu goes away entirely.
On a W2K system the menu appears, is active and the entire function of of the window works fine.
I must be missing something ?
Thanks in advance
Tony Teveris
<br />
int iCaptionHite = GetSystemMetrics(SM_CYSIZE) + GetSystemMetrics(SM_CYFRAME);<br />
<br />
CMenu *pMenu = new CMenu;<br />
pMenu->LoadMenu(IDR_VIEW);<br />
<br />
pFW->CreateEx(WS_EX_WINDOWEDGE,<br />
AfxRegisterWndClass(CS_HREDRAW | CS_VREDRAW, AfxGetApp()->LoadStandardCursor(IDC_ARROW),0,AfxGetApp()->LoadIcon(IDI_FONTVIEW)),<br />
"My Test",<br />
WS_OVERLAPPEDWINDOW | WS_POPUPWINDOW | WS_CAPTION | WS_THICKFRAME | WS_VISIBLE ,<br />
iCaptionHite, iCaptionHite, GetSystemMetrics(SM_CXSCREEN)/3, GetSystemMetrics(SM_CYSCREEN)/3, m_pOwner->GetSafeHwnd(), pMenu->GetSafeHmenu(), NULL);<br />
<br />
delete pMenu;<br />
<br />
pFW->UpdateWindow();
Tony Teveris
Gerber Scientific Products
Senior Software Engineer
Phone: 860 648 8151
Fax: 860 648 8214
83 Gerber Road West
South Windsor, CT 06074
|
|
|
|
|
Hi.
Would anyone know how to retrieve a mainframe hWND from a process handle ?
If you use openProcess to get a process handle, how can you find that process's mainframe hWND ?
|
|
|
|
|
You could go loop through the top level windows (children of the desktop)
and check if their process ID matches the one you are after...
See DWORD GetWindowThreadProcessId (HWND hWnd, DWORD *dwID);
I hope this helps,
Iain.
|
|
|
|
|
Hi
I succesfully added new storage into MSWord compound file (and new stream inside this new storage), but the problem is that when I open this doc in MSWord, made some change and save doc, my storage and stream dissapears. I saw application that adds stream(in root storage) which is "word saving proof" but I don't know how to do this. I also encountered strange thing: when I have word doc with stream added by this application, storage and stream added by me doesn't dissapear. I don't know why this happens. Anyone have some idea how to prevent new streams and storages from deleting by Word? Thanks in advance for any hints.
Greetings
Mariusz Popiolek
|
|
|
|
|
How do I extract file/path name from the HDROP passed from WM_DROPFILES??? Couldn't find anything here or MSDN
Nitron
_________________________________________--
message sent on 100% recycled electrons.
|
|
|
|
|
MSDN:
Drag-and-Drop Operations
To support a drag-and-drop operation in a rich edit control, an application must first set an event mask by using the EM_SETEVENTMASK message to allow the EN_DROPFILES notification to be sent to the control's parent window. In the RICHED sample, when the parent window receives this notification, the DragQueryFile function is called to determine how many files have been dropped in the rich edit control. This sample allows the user to drop only one file at a time, so if more than one file has been dropped, the action is disallowed. If the user has dropped only one file, the application queries for the filename, opens the file, and reads it into the rich edit control. As you can see in the following code, the sample allows the user to drop only a TXT or an RTF file:
case WM_NOTIFY:
§
// Is the notification a drop notification?
else if (((LPNMHDR)lParam)->code == EN_DROPFILES)
{
WORD cFiles;
char lpszFile [80];
HANDLE hDrop;
// Get the handle to the drop object.
hDrop = ((ENDROPFILES *)lParam)->hDrop;
// Determine how many objects have been dropped.
cFiles = DragQueryFile (hDrop, 0xFFFF, (LPSTR)NULL, 0);
// If more than one object has been dropped, don't bother.
if (cFiles > 1)
return 0;
// Get the name of the file dropped.
DragQueryFile (hDrop, 0, lpszFile, sizeof (lpszFile));
// Open the file (TXT or RTF).
if (strstr (lpszFile, "TXT"))
OpenTheFile (hWndRichEdit, SF_TEXT, lpszFile);
else if (strstr (lpszFile, "RTF"))
OpenTheFile (hWndRichEdit, SF_RTF, lpszFile);
DragFinish (hDrop);
return 1;
}
return 0L;
break;
This code demonstrates one way that an application can handle a drop operation. Rich edit controls also support OLE drag and drop through the IRichEditOle and IRichEditOleCallback interfaces, which allow objects to be embedded in the control. The subject of embedding objects is beyond the scope of this book, however, so I will not cover it here.
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|