|
Joaquín M López Muñoz wrote:
c2 is initialized. at the beginning , it is initialized to contain nothing. its just storage space for the API to write into.
By "the API" you mean that pointed to by BounceCheckPtr? What does this API do? Also, have you checked BounceCheckPtr is not null?
Yes, and its not null..The API determines status of a file. Im passing the contents of the file to the API via C1.
The API writes a string to c2 and returns a value as the status code of the kind of file it analyzed.
Also, szSqlStr has enough space for my needs, why do you suggest it to be bigger?
Well, c2 is 255 chars: without further info, seems reasonable that, under some ocassions, the strings stored in it can get near that maximum size, wich will overflow a 128 chars szSqlStr.
oh , ok... i see what you mean now, but i know that the c2 is only going to be between 10 - 30 charactors. really i guess i could clean it up a bit since i dont need the extra space, but i wasnt really worried about it... i was trying to figure out the mystery bug.
just to be sure tho, now that i see what you meant i tried setting szSqlStr to 400 ,still compiles 0 errors, 0 warnings, but im also still getting the mystery bug.
also since i know its the next logical concern, its also definetly not the API. The same .dll file for the API is working perfectly with a program i developed w/ VB.
|
|
|
|
|
Im passing the contents of the file to the API via C1.
Given the expression
BounceCheckPtr(*c1, *c2, len, *c3, *c4); seems what you're passing is not c1 , but rather the character c1[0] , unless the function accepts char& s or something like that. Is that the case? If not, could it be you meant to write this?
BounceCheckPtr(c1, c2, len, c3, c4); (Excuse me if I'm saying nonsense.)
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
You mentioned in one of your threads that it crashes on the line delete []c1.
If that is so then can you see through your debugger what is in c1 at the time of the delete?
Also, between
char * c1 = new char [length+1]; and the delete the only place c1 is used seems to be
result = BounceCheckPtr(*c1, *c2, len, *c3, *c4);
So comment this line out and then see if it crashes at delete[] c1.
If not then it is most like the BounceCheckPtr which is screwing up on the memory. It may be deleting what is c1 before you can delete c1.
|
|
|
|
|
Would anyone know how to write to a .rtf file (rich text), as well as change the color/face of written text, etc... I'm looking to make a log file with some different colors and fonts. Thanks!
|
|
|
|
|
You want to know RTF?
If so, I may have a suggestion for you. Create a Word document that will look like the log files you want to have. Then save the document in RTF and open the file in text mode and see the RTF formatting.
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
You can find the RTF 1.6 specification here[^]. It's very easy to follow and you should not have any difficulty. If you want to see how an RTF document looks like, write one in Wordpad (not Word, the RTF it generates is too bloated), and then open it in notepad to see how it looks like. Then if you read it side by side with the RTF spec, you will find it much easier to follow.
Regards,
Rohit Sinha
|
|
|
|
|
... COM threading models? (apartment, free, single, multi, both)
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
Read the following:
http://www.codeguru.com/activex/COMApartments1.html
http://www.codeguru.com/activex/COMApartments2.html
|
|
|
|
|
Tx for the pointers
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
I am developing and application in VisualC++ 6.0 and I want the interface to
be in Greek.
I have created all the items of the interface (doalogs menus etc) in Greek
and the application works fine.
However all the Windows dialogs (such as the Open file dialog) appear in
English.
Does anybody knows how could I make these dialogs to appear in Greek ?
(Without having to code them from scratch)
Thanks
Dionysis photeinos@lfme.chemeng.upatras.gr
|
|
|
|
|
They will appear in Greek when the user is running a Greek version of Windows.
Chris Richardson
Programmers find all sorts of ingenious ways to screw ourselves over. - Tim Smith
|
|
|
|
|
Thanks for the answer.
Is it possible however the dialogs to appear in Greek even if the user has the English version of Windows (I am sure this can be done somehow since MS Office (Greek) does it irrespectively of the Windows version, but I do not know how)
Dionysios photeinos@lfme.chemeng.upatras.gr
|
|
|
|
|
You need to change the regional and/or locale settings for the user.
( look in the "Regional Options" control panel. )
Max.
|
|
|
|
|
Has anyone ever programmed an application using a project/workspace model. I am writing an MFC / MDI applicaiton and I need to replicate the same idea that VS uses. The user will be working with a collection of documents. Are there any articles / tutorials that anyone knows of?
Ryan Baillargeon
|
|
|
|
|
Ryan B. wrote:
ever programmed an application using a project/workspace model
Yes, I'm currently doing this.- The app I'm working on consumes XML files. The "project" file is just another XML file that refers to the files in the project, as well as some project-wide properties. I use Xerces to parse XML.
- But you don't have to do this using XML - a simple approach is to use .INI files that basically do the same thing.
- A third approach is to represent the "project" object using a binary format that's serialized by your app. This is the least user-friendly way to represent a project but may be appropriate for your app.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
What's the problem? Create CProjectDoc class derived from CDocument, create CProjectDocTemplate from CDocTemplate. The document tree is your project view. Then you are creating some interface for you class, something likes as
void AddToProject(LPCTSTR szFileName)
void RemoveFromProject(LPCTSTR szFile) and etc.
The project is a simplest type of document I have ever seen.
Then, workspace's scheme: If you want use same tree for all open projects, you must refuse to use view in CProjectDoc. Point to MFC that you document has no any views
void CProjectDocTemplate::InitialUpdateFrame(CFrameWnd* pFrame, CDocument* pDoc,BOOL bMakeVisible)
{
pFrame->DestroyWindow();
}
and create separate window (of course, docked to a hair's breadth as microsoft - chief of fashion) and scan all projects and show their contents as you wish.
I had once similar project and i don't mind to share it with you, but it is simpler to make it on its own than to ransack some thousands lines of foreign code
|
|
|
|
|
The confusing part for me is that this is my first Document/View application and I am working from limited resources.
Your suggestions are very helpful and I was already heading in that direction. Thank you.
Ryan Baillargeon
Software Specialist
Fuel Cell Technologies Inc.
|
|
|
|
|
How to compress some files in a only one ZIP, TAR, ... file ?
Someone knows any function or method ?
Thanks,
Cris.
|
|
|
|
|
|
Also try searching for ZipArchive in the articles. There's a nice library there that takes only a few function calls to compress files into a zip file.
|
|
|
|
|
My initial problem:
I have a UNICODE application, it works fine in Windows
NT/2000, but I need it in Windows 95-98.
I'm trying to use MSLU in Windows95, but it doesn't work.
The problem seem to be with common controls (CEdit, CComboBox...) & menus (saved in my resource .rc file
like UNICODE)... all strings are shown like "____"
Somebody told to me: "Handle the WM_NOTIFYFORMAT message and return
NFR_UNICODE"
So, I tried to handle that message like this:
LRESULT CConnectorDlg::OnNotifyFormat(WPARAM wParam,
LPARAM lParam)
{
return NFR_UNICODE;
}
and in message map:
ON_MESSAGE(WM_NOTIFYFORMAT, OnNotifyFormat)
but my function never is called.
So, I tried too:
LRESULT CConnectorDlg::DefWindowProc(UINT message, WPARAM
wParam, LPARAM lParam)
{
if (message == WM_NOTIFYFORMAT)
return NFR_UNICODE;
return CDialog::DefWindowProc(message, wParam,
lParam);
}
But, common controls still are shown bad...
CConnectorDlg is a CDialog with a combo box and CEdit
Thank you in advance for your time.
Up the irons!
|
|
|
|
|
I'm trying to convert unicode (obtained from a file) into something readable.
i tried W2A and W2T but with no avail
|
|
|
|
|
Is it for debugging? If so:
VC++ 6.0:
Tool | Options, Debug tab, check the Display unicode strings check box
VC++ 7.0: Automatic
If it is not for debugging, could you please show some code? Also, the X2CX macros need the USES_CONVERSION declaration to work.
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
Hello All.
I'm working on an application using Doc/View. I was using SDI to create my application but I really need to display multiple views of a single document. I'm using splitter windows to divi up my views. Even though I am using multiple views, there is one view that will always be displayed when a document is open, so I have associated that View with the document.
My question is, Can I easily just use these other views against the document, and just get access to the document through the single associated view???
Thanks
|
|
|
|
|
What you want is multiple views with a single document...
Just create document templaes for each view, and associate the same document class to each template.
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|