|
error C2039: 'GetActiveDocument' : is not a member of 'CHpcComDoc'
why?? Can you help me??
|
|
|
|
|
Where do you code CProject4Doc* pDoc = GetDocument()?
You cannot get access to the document class inside of a dialog box class. There are several solution to getting access to data in a document class from a dialog box. A good solution depends on several factors include when you declare the dialog box. For example, if you delared the dialog box in a view class, then you could send a message to main frame and route the message to the view class. You could then pass data to the dialog box via public function.
Kuphryn
|
|
|
|
|
Try reading this article, it might help you get by.
http://cui.unige.ch/OSG/people/Past/fuentes/Mfc/HowTo_8.html
http://LessExpense.tripod.com
|
|
|
|
|
Hey! Thanks, this looks exactly like what I need!
Garry
|
|
|
|
|
Hi everybody
I am developing a windows project that will have as front-end devices instead of pcs , windows terminals. As a result the amount of resources will be limited. The server where the executebles will be located is a Citrix-XP server. Imagine that I plan to have a menu from where other executables will be called. As a result many time it will be necessary to pass data from the menu to the other executable and the opposite. So I am loooking for the most efficient way to achieve this data transfer. So far I have tried Name Pipes and it seems ok. Is TCP/IP another choice or in that case the need of resources will be bigger?
I will appreciate any suggestion from you guys.
Regards
Spiros Prantalos
|
|
|
|
|
|
In all honesty, I think that named pipes are implemented with TCP/IP underneath if you are remoting to a separate machine and memory mapped files if it is a local machine.
So I would say what ever you are more comfortable with.
Good Luck.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
I believe all data transfer over processes in Windows make use of file-mapping.
Another solution is the message queue. You could send a message to the corresponding process with a special data structure Microsoft designed specifically for data transfer across processes.
Kuphryn
|
|
|
|
|
Hi.
I am working on a print feature for a simple text program. The print algorithm should print data seen on a CEditView. The data is saved in a CString object.
I implemented the exact same printing algorithm Jeff Prosise shows in his book. However, I encounted two problems.
First, the program crashes under debug mode. The error is this line in viewedit.h.
ASSERT (nPageSize > 1);
Secondly, although the print algorithm does not crash under release mode, the program does not print. The program does send data to the print because the queue system that runs the print list the size of the data sent and the size is valid. However, the printer printed blanks.
Again, I implemented the exact same algorithm Prosise shows. Does anyone know if there are bugs in that printing algorithm?
Last, please post if you have any idea what the bugs mentioned above.
Thanks,
Kuphryn
|
|
|
|
|
I'd say the reason it is ASSERTing is that your pagesize is 0 or negative. The ASSERT statement checks that you supply a valid pagesize (> 1), and you apparently are not. Put a breakpoint on the line above ASSERT and check your actual nPageSize value.
|
|
|
|
|
You could take a look at my example application in the printing section which does just this:
http://www.codeproject.com/printing/PrintLongText.asp[^]
Roger Allen
Sonork 100.10016
I think I need a new quote, I am on the prowl, so look out for a soft cute furry looking animal, which is really a Hippo in disguise. Its probably me.
|
|
|
|
|
Okay. Thanks.
I looked over your source code. I believe there is a bug in Jeff Prosise code. Maybe the bug has something to do with the dimension of the page. I am not sure yet. I will modify his code via your code and try different combinations.
Kuphryn
|
|
|
|
|
Hi all,
I am using a Crecordset class to retrieve rows from an access database table. I am constructing the WHERE statement at runtime and pass it to CRecordset using m_strFilter. The problem is the following:
I need to query a date field in the database (rem_date) based on a date provided by the user (m_date). I am using the following code (v_filter is the where statement):
v_filter+="(rem_date=";
v_filter+="{d'";
v_filter+=m_date.Format("%Y-%m-%d");
v_filter+="'}";
v_filter+=" )";
The problem is that the above statement returns TRUE only when both the date and the (hidden) time is the same. I only need to compare the date portion. Do you know how can I do this?
I thank yuo in advance,
Christos P.
|
|
|
|
|
Do not exactly remember the function that will get you parts of the date in Access but you need to do something like:
Where DatePart( date_field, "mm-dd-yy") = DatePart( userDate, "mm-dd-yy" )
Try writing the query in Access it self first. Once you have it working you can can move it to your code by replacing the UserDate with the appropriate variable in your code.
|
|
|
|
|
Dear Ranjan BANERJI,
I would like to thank you for your reply but I feel that I have to exemplify my problem a bit more:
I am able to extract the date portion from the user-supplied date but I am not able to do the same for the date retrieved from the database.
What I need is the name of the SQL function that does this.
Thank you for your time,
Christos P.
|
|
|
|
|
Hi,
My program uses the libmysql.dll <- to access a MySQL database.
For my program to run, this dll needs to be with the program or in the system32 folder.
Is there anyway I can "Include" the DLL in my project? So I don't need to have the libmysql file laying around?
I know my program will be like 200 k bigger, but I really want to only have only one file, the EXE and not two the EXE and the libmysql.dll file
Thanks for your time.
|
|
|
|
|
Link the DLL statically to your exe. This will import all of the code into your DLL.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Thanks for the quick answer, but how do I do that in Microsoft Visual Studio 6.0 ?
|
|
|
|
|
I did a little research, and it looks like usually you would create a static library from a new project. Or at least you could set a few command line compiler parameters for you DLL in order to make it a static library. Look up "Creating a Static Library" for more details on this.
As far as converting an existing dynamic lib file to a static file, I am not sure if this can be done or if there are tools in VC++ to do it. I would look in MSDN a little or search on Google.
Good Luck
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
I hope it can be done..
Since I don't have access to the Project on the DLL I can't compile it as a static.
|
|
|
|
|
Hello,
I am attempting to assign a "Custom" state item image to a tree view item, however, I can't find any way to do so without having to provide my drawing funtionality. What I mean by "Custom" is having an alternate state assigned. For example, the following psuedo layout is what I am trying to obtain:
-- StateBitmap (Checkbox) - CustomStateBitmap - ItemBitmap - "Tree Item Text"
Not only am I attempting to have a "Checked" and "Unchecked" state, I would also like to allow my users to right click on this tree item and select a custom state to be set for this tree item. This custom state would correspond to the "CustomStateBitmap" above and would change dynamically.
This idea is enabling a secondary, standalone custom state, which only has meaning within the context of the application I am writing.
Any help or advice would be greatly appreciated.
Thanks,
Michael
Michael D. Wallis
|
|
|
|
|
I don't think the tree view supports that many bitmaps per item.
You could combine the CustomStateBitmap and the ItemBitmap as a single bitmap, something like this:
+----------------+
| +----+ +----+ |
| | CS | | IB | |
| +----+ +----+ |
+----------------+ Visually, the single bitmap looks like two bitmaps with a clear area between. Of course, this means you would have to have a set of bitmaps, one for each possible combination of "custom state" and "item".
Gary R. Wheeler
|
|
|
|
|
Hello,
Is there a simple way to override the default selection format indication for a CListCtrl---or stop the selection from drawing? The default behavior is for the selected CListCtrl (report) item to be drawn with a dark system color while inversing the text to white. I would like to use an alternative drawing scheme to indicate that the item(s) is selected. I would rather not choose to draw the entire control myself.
thanks!
JennyP
|
|
|
|
|
It's possible to do it using Custom Draw (without drawing the whole control). Take a look at "NM_CUSTOMDRAW (list view)" in the MSDN index.
Chris Richardson
|
|
|
|
|
Why do my drop down list want to automatically scroll back up when I'm trying to scroll down?
Is there some option that I have set to do this?
Thanks for the help!
|
|
|
|