|
There are a number of steps I would recommend if you want what I think you want.
Use VC++ 2005 or 2008 to create a simple Dll project using the wizard. Play around with this and understand what it gives you and how to use that Dll from another project.
Take a class or module at a time from the article and add it into a copy of your Dll project. For each object create the necessary externally callable Dll interface or a COM based wrapper and test it.
You should end up with a Dll with all the functionality in it and accessible from outside.
Using this from C# either by use of PInvoke calls or COM interop is one for the C# guys on the C# forum, I've only done a very little COM interop which is great once it's working.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
thank you very much Mathew.
excuse me for my late in respond (i did not have an internet connection for 1 day).
the main problem is that I want do this quickly and exactly and in a few efforts.
i try to test your useful and helpful way to do that.
if you or any other have better way or more comments i will thank.
thank you again.
|
|
|
|
|
hi friends,
Pgming Env. = VS 6.0
DataBase = MS Acess
My problem arised when i tried to fetch a coloumn in to combo box frm the acess, fetching is done fine. but when i click tw combo box next time all the values are getting repeated(adding up), how should i clear the old data or suggest me some ideas when playing around with combo box
thanks in advance....
||SnAkeBed||
|
|
|
|
|
SnaKeBeD wrote: ...how should i clear the old data...
Send it a CB_RESETCONTENT message.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
hi,
could u please tell me how do i send that message?
||SnAkeBed||
|
|
|
|
|
SnaKeBeD wrote: ...how do i send that message?
The same way you would send the CB_ADDSTRING message, unless MFC is hiding all of these details from you.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
I used a GUID to represent a portion of a unique file name do my file looked like: myfilename_GUID.txt
In C# i just do
String strRandomName = System.Guid.NewGuid().ToString();
However, what do i do in C++?
|
|
|
|
|
LCI wrote: However, what do i do in C++?
What's the problem? You previously stated that, "I used a GUID to represent a portion of a unique file name...", so did that work?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
He created the GUID in C# and he wants to know how to do the same thing in C++.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
LCI wrote: However, what do i do in C++?
They hid it in the documentation. Those Bastards!
The secret lies in searching the MSDN for "GUID" and "creating".
But maybe what you want is just ::tmpfile() or ::tempnam() from stdio.h ?
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
#if (defined(__unix__) || defined(unix)) && !defined(USG)
#include <sys/param.h>
#endif
#include <stdio.h>
#include <assert.h>
#if defined(_WIN32) || defined(__CYGWIN__)
#include <objbase.h>
#elif defined MACOSX
#include <string.h>
#include <uuid/uuid.h>
#elif defined __FreeBSD__
# if __FreeBSD_version >= 500000
# include <uuid.h>
# else
# error FreeBSD versions prior to 500000 does not support uuid(3)
# endif
#else
#include <uuid/uuid.h>
#endif
///Above are my includes, below is the calls abstracted
#if defined(_WIN32) || defined(__CYGWIN__)
GUID randomGuid;
// create random GUID
randomGuid = GUID_NULL;
::CoCreateGuid(&randomGuid);
if (randomGuid == GUID_NULL)
{
fprintf(stderr,"Couldn't create a random GUID\n");
return;
}
memcpy(m_bufuid, &randomGuid, 16);
#elif defined __FreeBSD__
uuid_t uid; // uuid_t is a struct
uuid_create(&uid, NULL);
memcpy(m_bufuid, &uid, 16);
#else
uuid_t uid; // uuid_t is defined as unsigned char[16]
uuid_generate(uid);
memcpy(m_bufuid, uid, 16);
#endif
std::string tmp;
char cuid[100]; // Uid::GetUid temporary
sprintf(cuid,"%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x",
m_bufuid[0],m_bufuid[1],m_bufuid[2],m_bufuid[3],
m_bufuid[4],m_bufuid[5],m_bufuid[6],m_bufuid[7],
m_bufuid[8],m_bufuid[9],m_bufuid[10],m_bufuid[11],
m_bufuid[12],m_bufuid[13],m_bufuid[14],m_bufuid[15]);
tmp = cuid;
Done.
-- modified at 8:48 Wednesday 31st October, 2007
|
|
|
|
|
Hey! I did not ask!
Anyway, your code is missing the m_bufuid declaration.
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
I pressed reply! Sorry it got pasted under you! That buffer is simply a char[16] buffer.
|
|
|
|
|
Hi,
How can i load & play an AviStream using the OpenInterface macro ? My code compiles just fine but it does not show anything.
void CWrapperDlg::OnPlayAVI()
{
// Create the window like you would any Windows control.
m_mciWnd.Create(WS_CHILD | WS_VISIBLE | MCIWNDF_NOPLAYBAR | MCIWNDF_NOERRORDLG | MCIWNDF_NOTIFYERROR, CRect(0, 0, 300,300), this, 1234);
// Open the AVI file.
HRESULT hr;
PAVISTREAM pstream;
AVIFileInit();
hr = AVIStreamOpenFromFile(&pstream, "test.avi", streamtypeVIDEO, 0, OF_READ, NULL);
if (FAILED(hr))
AfxMessageBox("error");
m_mciWnd.OpenInterface((PAVISTREAM) &pstream);
//m_mciWnd.Open(strAVIPath);
// Play the opened AVI file.
m_mciWnd.Play();
// To keep the demo simple - can't play the AVI file more than one time.
((CButton *)GetDlgItem(IDB_PLAY))->EnableWindow(FALSE);
}
Regards,
sdancer75
|
|
|
|
|
Hi everybody,
does it exist a maximal number of dialog ressources into a MFC Project.
My dialogs are under form of CFormView, but still now i have already over 25 dialogs
Does the project become buggy if a certain number of dialog ressouces is reached?
Big thanks for answers 
|
|
|
|
|
I don't think so. My project is having around 50 + dialogs.
Regards,
Paresh.
|
|
|
|
|
mmh, i'm at the beginning of the application and i have already more than 20.
I even don't know how much it will be in future, but seriously over 100 
|
|
|
|
|
I think u can have as many numbers u want.
Coz my application have 46..
Reagards
Shiva
|
|
|
|
|
Since they only get loaded when asked for and are discarded when no longer used, the number is, for all intents and purposes, limitless.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
The number of dialogs in your project resource file does not affect anything except maybe compilation time. Your application may use slightly additional memory with the definitions of those dialogs in the PE image. But nothing to be worried about.
Maximum number of window objects you can have open within Windows XP is 32767. There is a hard limit per process of 10,000 window handles. Yes, there is a point where too many open windows will degrade application performance. The threshold at which this will occur depends on processor speed and physical RAM.
I am increasingly becoming a fossil so my comments apply to my knowledge of the XP kernel, I have not delved into the Vista abyss yet. I am still waiting for the flames to die down.
Best Wishes,
-Randor (David Delaune)
|
|
|
|
|
hi to all
how to change the color of message box generated by AfxMessageBox("some line") function
thank u in advance
malik
|
|
|
|
|
You can't. If you want that type of customization, you'll need to roll your own.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
How can i do that when my dialog active text-cursor already active in the editbox?
Can anyone get the answer my question? My question seems to be quite open, i think.
-- modified at 6:47 Wednesday 31st October, 2007
What is this¿ "This is a FIRTBOY"
|
|
|
|