|
I saw that with my first try. The amount 78.90 became 78.9 - not that nice for display purposes.
|
|
|
|
|
I sent this to myself by accident.
----------------
It seems that I can use
_variant_t vt;
COleCurrency oleCur(vt);
CString strCur = oleCur.Format();
This will work for a date string as well
COleDateTime oleDT(vt);
CString strDT = oleDT.Format();
I have some testing to do.
I also found the DECIMAL conversion in Carlos Antollini's CADORecordset
double val = vtFld.decVal.Lo32;
val *= (vtFld.decVal.sign == 128)? -1 : 1;
val /= pow(10, vtFld.decVal.scale);
str = DblToStr(val); // also define in his class
Thanks,
RS
|
|
|
|
|
It seems that I can use
_variant_t vt;
COleCurrency oleCur(vt);
CString strCur = oleCur.Format();
This will work for a date string as well
COleDateTime oleDT(vt);
CString strDT = oleDT.Format();
I have some testing to do.
I also found the DECIMAL conversion in Carlos Antollini's CADORecordset
double val = vtFld.decVal.Lo32;
val *= (vtFld.decVal.sign == 128)? -1 : 1;
val /= pow(10, vtFld.decVal.scale);
str = DblToStr(val); // also define in his class
Thanks,
RS
|
|
|
|
|
Hi I want to change the name of my dll everytime I build it but dont want to manually edit my workspace each time. I can write a script to automatically edit the dsp file before building the dll, but does not seem to be a good solution. Does any one know of a VC++ option to do this or may be suggest a better solution.
Thanks for your ideas.
|
|
|
|
|
There are two ways (that I know of) of using a VBScript macro to do this:
a) Use the script to directly access the workspace Developer Studio objects and make the necessary changes. or
b) Use the script to modify the workspace file as a text file. This is the method that I normally use because it is then easy to apply search and replace operation to change project names, output names etc in text format. You can then get the macro to load up the workspace/project as usual. As an example, try this:
<br />
ExecuteCommand "SaveCloseAllThings"<br />
Documents.Open "myworkspace.dsw", "Text"<br />
ActiveDocument.Selection.StartOfDocument<br />
blnFound = ActiveDocument.Selection.FindText("ProjectName")<br />
If blnFound = false Then<br />
ActiveDocument.ReplaceText "ProjectName", "NewProjectName"<br />
End If<br />
ActiveDocument.Save<br />
Documents.Open "myworkspace.dsw", "Auto"<br />
whichs opens myworkspace.dsw, finds all instances of "ProjectName" and replaces them with "NewProjectName", saves the changes, and then loads up the file as a normal workspace. The initial "SaveCloseAllThings" has only been included to make sure that all active windows are closed.
|
|
|
|
|
I'm a Maths student. Now I'm having a project that I need to call Maple inside my project and do some calculation. Anyone has experiences on this please help me.
|
|
|
|
|
You could be more specific about your problems. You can use maple routines and data structures in your C/C++ application by using the OpenMaple API and it's easy to find example program listings from the net. Did this help?
- Jussi
|
|
|
|
|
Firstly, Thanks.
I can explain it clearer like this:
+ In my project, I let the user type some text in LaTeX format and I want to let to user do some calculation. For this, I need to call Maple. I don't know how can I do this !!!
Would you please give me some more details???
|
|
|
|
|
I am trying to build a dialog to allow the user to select directory
path as in Visual basic.
|
|
|
|
|
SHBrowseForFolder()
I'm not sure if I get your point.
Rickard Andersson
Here is my card, contact me later!
UIN: 50302279
Sonork: 37318
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|
I know that I have asked this, but I need to understand what is going on.
If you create a CRichEditCtrl on the screen (canned width/height), then make the default font 12 point Times New Roman. Enter in a string of characters until it wants to wrap (stop just prior to the wrapping). Now, get the text along with the font information and calculate the width of the string. What I'm finding is that the same string that is to be drawn to the screen is wider than the control! How could that be?
Any help would be appericated.
Larry J. Siddens
Cornerstone Communications
TAME THE DOCUMENT MONSTER
www.unifier.biz
|
|
|
|
|
I guess that I have you guys stumpped!
Larry J. Siddens
Cornerstone Communications
TAME THE DOCUMENT MONSTER
www.unifier.biz
|
|
|
|
|
It's easy to cause an internal compiler in VC6! Just add this class to your project:
class CFoo
{
public:
CFoo();
virtual ~CFoo();
};
CFoo::CFoo() {};
CFoo::~CFoo() {}
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Every programmer has been generating compiler errors since their "Hello world", what's your point?
|
|
|
|
|
I was just pointing out another instance of how to generate an internal compiler error in VC6. Sorry if my post upset you.
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I was not upset at all, actually I was a little confused by your purpose about generating internal compiler errors.
|
|
|
|
|
Yeah I saw this in April of 2001. I saved it in a file "Crash The Compiler.txt":
CTextView::CTextView
: CCtrlView( "GC_EditClass", 0 )
{
}
I've spent a lot of time working on various compilers, so I can understand how these cases slip through. I was however, quite proud when I found this one, for some reason.
Chris Richardson
|
|
|
|
|
Having spent a while building an audio app, I decided to bastardise some SDK code examples to speed up development, however the classes I have created rely upon "dsutil" and the "dxutil", headers and Cpp files. The Cpp files throw C1010 errors when being complied, claiming "unexpected end of fle while looking for precompiled header directive".
I have experimented with changing the settings on these files to not using precompiled headers, but this is new ground for me and I don't really know whats causing this. Any help much appreciated!!!
|
|
|
|
|
The very first line in those .CPP files should be a #include "stdafx.h" statement.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Thanks for that, I'll go give it a try in a mo. This is a new area for me, I've never needed to include stdafx.h in cpp files in previous projects, whats caused these cpp files to need it?
If this requires a detailed answer, could you point me in the direction of some notes on header directives etc? Thanks again!
|
|
|
|
|
Mad doc`s hairy belly wrote:
...whats caused these cpp files to need it?
Precompiled headers compiler option.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Hello all
I've a CEdit control which has multiline and vscrollbar properties set. The problem I'm having is whenever the text exceeds the editbox size vertical scroll bar is not scrolling along with the text downwards. Instead I need to scroll the vertical bar manually to see what's there in the edit box.
If anyone knows how to solve this problem, pls help me.
Many thanks for your help.
Hari.
|
|
|
|
|
You mean if you insert text programmatically, right?
If so, then you must scroll the text manually after setting the caret at the
end (no MFC here...):
int textLength = ::GetWindowTextLength(hWndEdit);
::SendMessage(hWndEdit, EM_SETSEL, (WPARAM)textLength, (LPARAM)textLength);
::SendMessage(hWndEdit, EM_SCROLLCARET, (WPARAM)0, (LPARAM)0);
--
Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so. (Douglas Adams)
|
|
|
|
|
Hello Johann
Thank you very much for the reply. Your code solved my problem. Thanks a lot.
Hari.
|
|
|
|
|
Hi,
I've been working on a project for a while, but I have run into a speed bump, my query works fine on any SQL connection to my Informix Database, but I just can't get VC++ to run it. It runs as long as I don't add the COUNT(*) and GROUP BY expressions, but as soon as I add that I get the General error.syntax error. Any help or ideas will be appreciated!! Here it is:
INSERT INTO acnd_upc (upc, dist)
SELECT store_upc.upc, count(*) from store_upc, link_link, store, division
WHERE store_upc.linxscd=link_link.linxscd
AND link_link.store_id = store.store_id
AND store.division_id = division.division_id
AND division.channel_id = 'XX'
AND division.first_cycle != '9999-99'
AND dist = 1
AND upc = '99999999999'
AND date_stamp = (SELECT MAX(date_stamp) from store_upc
where upc = '99999999999')
GROUP by store_upc.upc
Thanks!
|
|
|
|