|
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
|
|
|
|
|
Pending means waiting inthe queue on server side,
let say Iset the blacklog to 3, what will happen?
A maximum of 3 will stay in the queue untill they are served!
U can accept a conection with the accept function
Papa
Murex Co.
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Thanks for the explaination!
But what about the case "SOMAXCONN"?
Thanks!
Nachi
|
|
|
|
|
|
I have an Edit control for hex input, and I'd like draw it with spaces between every two characters (the user doesn't actually type any spaces):
43 4F 44 45 50 52 4F 4A ... etc
I'd rather not use SetWindowText to shove the spaces directly into the text, since I'd have to have special handling for editing, cutting, pasting, undo, validate and all.
Is it possible to do the formatting at display time instead? I looked through the MFC source and I didn't see any CEdit draw methods that I could override.
|
|
|
|
|
Look in the CEdit section here, there are several masked edit classes if memory serves.
|
|
|
|
|
The masked edit classes keep the literals within the data, and so they have to have special processing for all edit and cursor functions. I could adapt one of these useful classes to insert that space every two characters, but it seems like overkill.
I'd like to keep the text data the way the user enters it, and mess only with how it would get displayed. My idea is to grab the draw method for CEdit and override it with a function that formats a copy of the text right there, and displays it. I like minimal added logic.
Problem is, I don't have any idea where the CEdit control is drawing itself. I looked in the MFC sources and I can't find anything like CEdit::OnPaint(). Can anyone offer any clues on this?
|
|
|
|
|
Mabe you can handle EN_UPDATE and reset the text in the control to have every third letter a blank?
|
|
|
|