|
Hi!
I'm having trouble with my MFC mapeditor. When I load a file the application changes the path to the directory the loaded file was in. How do i change it back?
I have my maps in maps/ and then I have a file called objects.ini in my basedirecotry. But if I load a map i can't do something like: fstream file("objects.ini").
Thanks for your help
|
|
|
|
|
It's usually never a good idea to use a relative path. Use an absolute path and you'll always be safe.
"Ideas are a dime a dozen. People who put them into action are priceless. - Unknown
|
|
|
|
|
if you are facing this problem with CFileDialog. Use OFN_NOCHANGEDIR flag in the cunstructor paramater of CFileDialog.
suhredayan There is no spoon.
|
|
|
|
|
I am having trouble Opening a CRecordset whose SQL select stmt returns a text column.
When the m_rs_data.Open(...) executes, the method triggers an exception that returns "Data truncated" in a text box.
Can anyone tell me how to properly fetch a row from my dB when the table includes a TEXT column?
Any help would be most appreciated.
Here's the code (some details left out)
CDBInstance *dbInstance<br />
CString sql = "select UID,XId,MsgSeqNum,Time,Dirctn,BeginString,SenderCompId,TargetCompId,OnBehalfOfCompId,DeliverToCompId,SenderSubId,TargetSubId,OnBehalfOfSubId,DeliverToSubId,Sender_C,Receiver_C,MsgType,TransactTime,<br />
rawFIX,CreateDate from TxAudit.dbo.AuditLog "<br />
<br />
CRecordset m_rs_data(dbInstance);<br />
<br />
m_rs_data.Open(selectSQL<br />
, CRecordset::dynaset<br />
, CRecordset::none);<br />
|
|
|
|
|
This error occurs when any of the data exchange field is smaller than their corresponding column in the database. A common chance is when any database column has a varchar field greater than 255 in size and the RFX_Text() function is called with default value of 255 for nMaxLength parameter.
suhredayan There is no spoon.
|
|
|
|
|
Is there a method I can call that will change this default value? Or some way to override the default, say, when I construct CRecordset??
I'm actually using a class (CODBCRecordset) that's wrapped around CRecordset. The only method I call is CRecordset::Open(...) ....
Link to CODBCRecordset
http://www.codeproject.com/database/parameterodbc.asp
|
|
|
|
|
BTW, if I change my select SQL to say something like :
select cast(rawFIX as varchar(4000)) as "rawFIX"
the Open(...) does not raise an exception ....
|
|
|
|
|
Hi,
I have a dialog with a ListBox Control. I want to map it, using ClassWizard to CCheckListBox but ClassWizard only let me to map it to CListBox. How can I set ClassWizard so I would be able to choose CCheckListBox.
thanks,
yaron.
|
|
|
|
|
You'll need to modify the .h and .cpp files manually. Just open the two files and change all references of CListBox to CCheckListBox .
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
A developed a MFC project with a menu resource.
During my program execution, the underline characters of the menu are only shown while the Alt key is pressed; if the menu is opened via the mouse then they are not shown.
How can I change this, so that the underline characters of the menu are always visible?
Teresa
|
|
|
|
|
desktop->right click->properties->appearance->effecte->"hide underlinedletters untill i press ALT key".
suhredayan There is no spoon.
|
|
|
|
|
Teresa Azevedo wrote:
...the underline characters...
These are called mnemonics.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hi i'm trying to build a ms access database controller using visual c++ using the ado format. This also has to have client sever using ip addresses. does any one have any example code of a working system?
or a tutorial to follow to conplete this?
regards
|
|
|
|
|
sir i have added Microsoft Forms 2.0 Textbox from the registered active x controls in VC++. while executing my project i can't able to type anything into tha text box. why? pls give me the answers.
|
|
|
|
|
microsoft forms packages are not supposed to be used from other than VB.
suhredayan There is no spoon.
|
|
|
|
|
The question goes to Microsoft insiders (employees). Are there any new classes, controls, etc...?
Software is too expensive to build cheaply...
|
|
|
|
|
Hi ppl.
I have a HWND of a ListCtrl with report style.
I want to know the no of columns it has.
F1 please!
|
|
|
|
|
SendMessage(SendMessage(hListCtrl, LVM_GETHEADER, 0, 0), HDM_GETITEMCOUNT, 0, 0);
|
|
|
|
|
Great!!!
I was about to post this solution myself, but you did it first.
Thanks (beerboy_22);
this is this.
|
|
|
|
|
An one know how to add a shortcut or a program into the folder Network Connections in Control panel?
Thank you in advanced
Long
|
|
|
|
|
Hello, I have started a MFC project in Visual C++ .NET 2002, over Windows 2000. I wanted to use the new XP controls, so I left checked this option in the wizard, and everything was right until I used a wrapper class for CToolBar, this class override the function OnEraseBkgnd() and put a bitmap image as background. Under W2000 works, but under XP the Toolbar appear unchanged, as if the WM_ERASEBKGND message wasn't processed.
Can anyone help?
If it can't be solved, Does anyone know how can I remove the XP controls from the project?.
Thanks.
|
|
|
|
|
I've have the same problem with dialogboxes; you erase the background your way and windows ignores that and does it its way.
A solution I do not like, but works every time: Do your drawing in the OnDraw() or OnPaint(). The problem here is that you may (or may not) see it flicker, since the drawing is actualy being done twice.
Good luck!
Signed: John R. Shaw
|
|
|
|
|
Hi ppl,
I have one more conversion question for you guys.
mdisplay is a cstring variable. I need to convert this to char in order for strtod() to work.
I am using strtod, to convert to float.
thanks in advance.
-hithesh
|
|
|
|
|
CString strPrice(_T("22.5"));
TCHAR* szPrice = strPrice.GetBuffer(strPrice.GetLength());
//do your conversion here
strPrice.ReleaseBuffer();
suhredayan There is no spoon.
|
|
|
|
|
Sorry Suhredayan !
strtod function takes const char * as argument. So no need it to convert into char * you can directly pass CString to it, as CString exposes LPCTSTR operator!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|