|
hi,
i've to reallocate a CString class member on runtime, i can't change the declaration in the parent class because it's a library but do it in the derived class.
The problem is that assigning to the CString a value the program exit with
HEAP[Sample1.exe]: Invalid Address specified to RtlFreeHeap( 5f0000, 5f4ccb08 ). Using .Empty() .ReleaseBuffer() and similar there's no errors, only assigning something.
It's a problem in the member allocation?
|
|
|
|
|
another thing, i use the debug version of the library with debug mode on.
|
|
|
|
|
I thinh you should post some code of what you are doing so we can better determine your problem.
Best regards,
Alexandru Savescu
|
|
|
|
|
i'm trying implementing a Cdocument derived class for the TX Text Control (www.textcontrol.com). the tx views needs this CTXDoc derived from CDocument. The component is created for an application with only a tx view and nothing else (this is very bad). In OnOpenDocument, OnNewDocument,etc it sets, deletes the contexts of the view,etc so if you call this overloaded funtions the program crash with diffent views. So i've substitued CTXDoc:: with CDocument:: and set the things for the tx init. But opening a created document, when SetPathName is called, there's an assignation to m_strPathName and m_strTitle of the CDocument and there's the Heap. I don't know how to solve, i've created the same variables in the derived class and rewritten SetAppName and GetTitle but in the others part of the application if there's a call to GetTitle it returns the CDocument variable that it's ""
|
|
|
|
|
I have a bit of a problem. I'm trying to write a plugin for Trillian Pro, but the example code is all C, and I've only had any luck modifying their example rather than writing my own dll from scratch.
I really want to use some C++ functionality (namely Ravi's Web Resource Provider)
Is there a simple way I can wrap up a C++ class into a .lib file so I can call it from C code?
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
I am afraid you cannot do that. C++ is a superset of C, so basically C is not aware of C++. Anyway, you can do the other way arround. From C++ call C functions. So my suggestion is write your application in C++ and use from there the C functions. Also make sure you add extern "C" when including C-header files.
Best regards,
Alexandru Savescu
|
|
|
|
|
Sadly that's not possible - I'm working with provided framework code that has to be C, so the main base of the code can't be modified to C++ else it won't work with the plugin API.
I was under the impression that it was possible to link c++ and C code together (initial experiments show that VisualC will happily link a C++ .lib file into a C project. It only complains when you try and access the code in the lib)
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
I think that your best bet will either to write COM object (which is a lot of work to use in C), or write a set of wrapper API functions that are exported from your DLL that will allow you to use your class from C.
These function will end up similar to the windows API, where you will create a function like CreateObject() that returns a handle to the new object pointer that you create.
Then when you call a member function you will pass in the handle to that object, and your DLL will translate the handle to the object and call the desired member function.
The reason that you cannot use a C++ class in C is because of the hidden this pointer that is included in all of the C++ class member functions. There are other ways to get around these problems, but I would really suggest one of my first to solutions.
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!
|
|
|
|
|
Dear All,
i am going to design a mail client that will enable the user to enter login id and password for any mail server.then this client will read all the mails from that server and will show them to the user. is it posible plz
guide me how can i do this. i am very new in this field.
i will use VC++ as for development.
mail server may be any like yahoo, hotmail etc.
waiting for reply.
lodhi
|
|
|
|
|
There are plenty of articles here that discuss retrieving mail from POP3 servers (the normal kind of mail servers that most ISPs use) - just do a search for POP3 on this site
However retrieving mail from yahoo or hotmail is a lot more complex, as they don't provide standard protocols to access email on their servers
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
I've used MAPI to access hotmail through a telnet session. This is when I was just familiarizing myself with MAPI commands.
|
|
|
|
|
|
The GDI+ feature can be easily redistributed. GDI+ is standard on Windows XP. For Windows 98, Windows Me, Windows NT® 4.0, and Windows 2000, you can simply copy GdiPlus.DLL into your app's directory.
Gdiplus[^]
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.
|
|
|
|
|
|
Hi!!
I want to call SQL server stored procedure via ADO. I create command object and append to it the input parameters. Now i want to reuse this command object on some different stored procedure having different input parameter list. So i've to remove all the previous parameters from command object. How can i do so ???
|
|
|
|
|
It's quicker to create a new one.
STL is a religeon. Enquiries to Reverend Christian Graus
|
|
|
|
|
Hi,
I like a lot of having this: Data Layer / Bussiness Layer / and GUI Layer... for a web based project I understand how it works but....
What about a Desktop approach... this case: I need to show in a DB Grid, a query or table, that can have 5, or 5000 thousand elements, how can I do this in a Layered approach ?
Should I make a control that gives me the number of elements, and pages of b.g. 50 rows..., and Have one special control that will show the 50 and simulate the scroll for 5000 thousand ?, Is that already done somewhere ?
Or should I pass a Recordset as a parameters from the ActiveX control to the App ( then what about the open Database Connections... ?).
Thanks in advance, Greetings
Braulio
|
|
|
|
|
From within an event handler in an SDI main frame class, how do I get a pointer to a modal dialog box or property sheet where pointer->IsKindOf will return the dialog box / property sheet class?
I have tried
CWnd * pForeWin = GetWindow(GW_HWNDNEXT);
if (pForeWin->IsKindOf(RUNTIME_CLASS(CMyPropertySheet)))
{
But GetWindow returns a pointer to a CtempWnd.
Thanks in advance
Alec
|
|
|
|
|
Hi all! pls help me.
I need a CRichEditCtrl in a dialog to show text with images in it. When i copy/paste document, it shows text but not images.. Why?
|
|
|
|
|
The compiler information me that :\microsoft visual studio\msdev98\myprojects\newprint\cprinter.h(71) : error C2011: 'CPrinter' : 'class' type redefinition
Why did the error appear?
|
|
|
|
|
MSDN:
Compiler Error C2011
'identifier' : 'type' type redefinition
The specified identifier was already defined as type type.
The following is an example of this error:
struct S;
union S; // error
Papa
Murex Co.
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
It could be a number of reasons. One of the most usual is that you forgot to insert safeguards against multiple inclusion:
#ifndef CPRINTER_H
#define CPRINTER_H
#endif
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hello,
I am learning socket programming in windows right now, however, I have some problems with the second parameter when I using this function: listen(socket, int). I don't understand what the second parameter for and how to use it. Thanks for someone to help!
Nachi
|
|
|
|
|
MSDN :
int listen (
SOCKET s,
int backlog
);
backlog
[in] The maximum length of the queue of pending connections. If this value is SOMAXCONN, then the underlying service provider responsible for socket s will set the backlog to a maximum "reasonable" value. There is no standard provision to find out the actual backlog value.
So its the number of pending connection on the server side, cos a listening socket is on server side!
its up to u to know how manny u need in the queue waiting to be served by the server!
Papa
Murex Co.
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
I am sorry, what do you mean pending connection? Would you mind to give me an example, let say Iset the blacklog to 3, what will happen? Thanks!
Nachi
|
|
|
|