|
Hi,
I utilize Visual C++ 6.0.
I have develop an application with menus and dialogs in SDI.
I want to transfert it to a MDI application.
There is a way to keep my dialogs and menus and transfer it to the MDI
project ?
Thanks,
Claude
|
|
|
|
|
Hi all,
I'm creating a small application that uses DAO (I know, it's old-fashioned!).
I need to store in a field a text with more than 255 characters. So far I have used:
dbTable.CreateField("Error",dbText,255);
with success, but with the 255 limitation. I tried:
dbTable.CreateField("Error",dbMemo,2048);
but it's still 255-limited.
How can I create a field for a long text?
I'd appreciate any ideas.
Thanks a lot.
-- narada
|
|
|
|
|
Hi,
first of all memo fields do have an initial length of zero.
Then check your UpdateData function, if there is a length restriction.
This can be done by explicitly setting the text length of the control or by DDV_MaxChar(....).
G. Steudtel
|
|
|
|
|
So you don't think this is an Access restriction?
|
|
|
|
|
Visual Studio.NET refuse to compile this. get type cast error
in VS 6 it works.
CGridItem* CMyGridCtrl::GetNextItem( DWORD h )<br />
{<br />
std::vector<CGridItem*>::iterator it;<br />
<br />
it = ( std::vector<CGridItem*>::iterator )h;<br />
<br />
it++;<br />
if( isItemValid( it ) )<br />
return (*it);<br />
return NULL;<br />
}
|
|
|
|
|
Try
it = reinterpret_cast< std::vector::iterator >( h)
as the two types are totally unrelated.
[edit]Or did you try
it = static_cast< std::vector< whatever >::iterator >( h)
with whatever being the type of your vectors datatype.
[/edit]
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
reinterpret_cast didn't work..
The interator is casted to DWORD becouse some of the classes are also used in other projects and types is not known there.
Properly some bad design somewhere. But I don't want and have the time to rewrite tons of code.
This is just one of many type cast problem. But it looks like most of the problem are handles/DWORDs getting casted to interators.
|
|
|
|
|
yes
Cut and Paste Error..
it should say
it = static_cast< std::vector< CGridItem* >::iterator >( h)
nothing works. strange..
|
|
|
|
|
Problem has been solved. I think..
On VS6 I'm using SGi STL instead of the one included by MS in VS6..
But in VS.NET I was using the provided.
But when I changed so SGI STL is used in VS.NET those compile error went away
But I get some strange warnings instead on other stuff. But I think I can ignore them. Looks like the program is working now.
|
|
|
|
|
Hi,
In one of my project, I am plotting the line for some trajectory, in addition to this I want to show a blinking object at the beginning of the trajectory. I tried creating a bitmap (8 x 8) and tried to put it on the screen with BitBlt function in VC, but it's disturbing the line plotted. It should not distrub the plotted things, How to do it?? Can anybody give some idea or some code??
Regards
Satya
|
|
|
|
|
Could you use an OS caret to do this? Use CreateCaret() and set the height/width of it and position at the start of your tradjectory.
May so what you need and then the OS can handle all the drawing stuff for you.
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
I need to insert a very large number of items into a CTreeView derived control. This insertion takes a long time, so I am doing is asynchronously.
My problem is: whenever I call InsertItem, the tree selection jumps to the newly inserted item. I want to prevent this, so that my user sees the tree being built, but is able to select an item in the tree and have the selection remain on that item.
How would I go about doing this? I tried looking for and using different window styles, and I tried intercepting the TVN_SELCHANGED and TVN_SELCHANGING messages, but wasn't quite able to achieve anything...
I want it to behave sort of like IE does when you open a huge (and I mean HUGE, as in 1MB) XML file.... IE parses the file in the background, and keeps adding new nodes to it, but you are able to view whichever part of the document (that has already been loaded you want).
Thanks,
-CD
|
|
|
|
|
One solution is to keep a reference of the current selected item. Upon inserting new items, call TreeView_Select().
Kuphryn
|
|
|
|
|
The problem was that after inserting each item, there was a call to Expand(), which caused the treeview to scroll to the newly expanded icon. This did not have any visible effect when the tree was being populated off-screen, but once I started doing this in a separate thread after showing the treeview, it was apparent in the tree jumping all over the place.
It turns out (this is code I inherited from someone else at my company) that the proper thing to do, instead of calling Expand() after inserting each item, is to set the State bits (and the mask bits) in the TVINSERTSTRUCT before inserting the item, this causes it to be expanded when it is inserted, without the tree scrolling to it.
Thanks anyway for your help.
|
|
|
|
|
How do you set the dropped height of a CComboBox that is created dynamically?
|
|
|
|
|
MoveWindow() is what you need. Move the window to the area the combo needs and the drop area. The combo will only use the top part when the drop area is not shown. When the drop area is shown, this will expand down to the window coordinates specified in the MoveWindow() call.
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
Hi,
Because of dependencies to external software (and their SDKs) that uses MFC4.2 in old versions of their software and MFC7.0 in newer version I have to compile two versions of my software, one under MFC4.2 and one version under MFC7.0.
Is there any way that I can accomplish this without maintaining separate dsw and sln files?
Is there any way of setting up my project to use another compiler/linker?
Thankful for any help,
Johannes
|
|
|
|
|
HI,
I have a problem concerning MFC with visual C++ 6.0
I want to insert item in a Tree. This Item will be selected via a menu which will open a window for the item selection. that is for the context!
I have problem of classes and i don't understang very well which classes must I choose for my differents window. Could you help me ?
For the tree which is in a the main window i choose a form view
and for the others windows ( for item selections) i create my own class.
But it doesn't work.
Sorry for mistakes,
i am french
|
|
|
|
|
Hi!
I have to write an application, which should communicate over a Bluetooth dongle for USB. Since I never wrote any drivers or such hardware based applications before, I have no idea how to handle this. The MSDN only offers information for Windows CE, but this application should run under Windows 2000.
Can anyone help me???
|
|
|
|
|
Before I rush off and port Chris Maunders extended tooltip article to WTL ( ), I wondered if there was an easier way to get multiline tooltips to display? It seems that Windows already has support for this (such as the tips displayed on quick-launch icons on the task bar) - can I not leverage this somehow?
When I am king, you will be first against the wall.
|
|
|
|
|
Groan. I solved this by using a combination of TTM_SETMAXTIPWIDTH and "\r\n" to force new lines. I expect "\r\n" to just work, but it seems you must send a TTM_SETMAXTIPWIDTH first.
When I am king, you will be first against the wall.
|
|
|
|
|
Hi, there.
I've got a problem with using property sheet.
Actually, I wanted to use Tab control, but it is really hard and complicated to add some controls on each tab.
so I decided to use property sheet.
I have 4 independent MFC(exe) projects.
Those are not related each other except input parameter.
With one input parameter, 4 projects make diffent kinds of results.
Each project does File I/O and uses even FileDialog.
I tried to put each project on each property page.
(using copy and paste)
However, I faced some serious problem.
Each project has OnInitDialog function, but each property page doesn't have it.
Can I just add this function on each property page?
(Actually I tried to do that, I couldn't get the results what I wanted.)
Without OnInitDialog, any project doesn't work properly.
I really want to combine 4 projects to one dialog box.
How can I solve this problem?
Do I have to use other methods to combine them?
Please help me.
Thank you!!!
|
|
|
|
|
Try to do your one-time-initialisation in the OnSetActive() of the page, but guarded by a bool to be called only the first time.
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
I don't understand... I have used for a long the property sheet and each page has its OnInitDialog function (If I have needed it, of course...).
The only problem is that property pages are not created until they have been focused unless you set this flag in their creations: PSP_PREMATURE
from MSDN:
PSP_PREMATURE Causes the page to be created when the property sheet is created. If this flag is not specified, the page will not be created until it is selected the first time.
Hope this helps...
|
|
|
|
|
I am writing a program which runs just fine in the computer where I am developing it. The OS is Windows XP. Since I wanted someone else to see my program I tried to run it on an old laptop that I have which runs on Windows 95. Unfortunately I got an error generated with _com_error which says:
Error Number: 0x80040154
Error Message: Class not registered.
I fixed this error by installing DCom95 and MDAC 2.5 Service pack 3 because they were required for windows 95.
However I get another error which says:
Error Number: 0x80004002
Error Message: No such interface supported.
This is part of the code
// Initialize the COM environment
if( FAILED( hr = ::CoInitialize( NULL ) ) )
{
_com_issue_error( hr );
}
// Create a connection with the database
// THE FIRST TIME THE PROGRAM WOULD FAIL RIGHT HERE
if( FAILED( hr = m_pConn.CreateInstance( __uuidof( Connection ) ) ) )
{
_com_issue_error( hr );
} // end if
m_pConn->Open(L"Provider=Microsoft.Jet.OLEDB.3.0;\
Data Source=SomeDbFile.mdb;",
L"", L"", adOpenUnspecified );
// NOW IT FAILS RIGHT HERE
// Create an instance of Command
if( FAILED( hr = m_pCmd.CreateInstance( __uuidof( Command ) ) ) )
{
_com_issue_error( hr );
} // end if
Besides installing DCOM95 and MDAC Is there anything that I can do to to make the program run in Windows 95?
none
|
|
|
|