|
There is a WordPad like sample in the Visual C++ Samples. (MSDN search should find it) This should give you a good starting point.
Michael
Fat bottomed girls
You make the rockin' world go round -- Queen
|
|
|
|
|
thank you very much for your valuable information
|
|
|
|
|
Hey all,
This is a bit of a stupid question and probably has an obvious answer, but ill ask anyways.
Ive created a Win32 project in .NET that outputs as a DLL. In it ive added 2 classes and put all my code in, and now i want to call it in either C# or MC++. Problem is, i dont know how to add it at all (in C# its under project->Add reference i think, but it keeps reporting that it cannot add it bcos its not a .NET assembly). Can anybody give a quick pointer ??
Thanks in advance
Ubersnack
Where theres a will, theres another money-grabbing no-good....
|
|
|
|
|
Well if you created a Win32 dll than that obviously is not an assembly - you need to create a .Net dll (which is an assembly essentially). Or use pInvoke to call the win32 dll from C#.
|
|
|
|
|
If I compile a code that uses MFC the size goes about 36KB. If i compile almost same code tht doesnt use MFC its size goes to 56KB.
How can I reduce the size of my exe file.
In my dream, I was dorwning my §orrow§
But my §orrow§, they learned to §wim
|
|
|
|
|
But the 36k is without the mfc dll. Trust me, in the end, a program with mfc is _much_ bigger than a plain C one
|
|
|
|
|
Hi!
I am writing a custom window control in MFC: a tab control.
CWnd
A
|
|
MyTab
class MyTab : protected CWnd {
public:
void add(const CString& title, CDialog* dlg);
...
protected:
...
private:
...
};
Everything goes well. Now I want to seperate interfaces from implementation theorically:
CWnd ITab (abstract class as interface)
A A
| /
| /
MyTab
class ITab {
public:
virtual void add(const CString& title, CDialog* dlg)=0;
};
class MyTab : public ITab, protected CWnd {
public:
virtual void add(const CString& title, CDialog* dlg);
...
protected:
...
private:
...
};
This time, the problem exist: there is no HWND attached.
Does anyone know how to solve this? Or is there an alternative design?
Any reply would be appreciated.
sovann.
Why waste time learning while ignorence is instantaneous ? [Hobbes]
|
|
|
|
|
Sovann wrote:
This time, the problem exist: there is no HWND attached.
I have not understood what it means (hwnd of what???), but I want to give you small advice: mfc classes must be first at deriving order (MSDN says that). Swap 'public ITab' and 'protected CWnd', otherwise you will have a problems
|
|
|
|
|
I've set a waitable timer (Create/SetWaitableTimer API) to 10 seconds. Since it's been
created in a window, I can't use WaitForxxxObjectxxx sync function. So I wanna use a
feature that SetWaitableTimer encapsulates, a call for completion routine.
How can I assure the call for 'PTIMERAPCROUTINE' when a the timer has elapsed??? I read the the creating thread must be 'alert' , but I don't want to use the sync API's.
HELP!
--BlackSmith--
/*The roof is on fire, we don't need no water, let the MF burn*/. BHG.
|
|
|
|
|
BlackSmith wrote:
I can't use WaitForxxxObjectxxx sync function.
But you can use the MsgWaitForMultipleObjects
My latest article:
SQL Server DO's and DONT's[^]
|
|
|
|
|
hi there,
I have a console project where i wanted to use the exit() function, but no way, the linker does not recognize it. MSDN says it is defined in <stdlib.h> which, of course, i have included in the file. Any idea ?
#include <stdlib.h>
#include <stdio.h>
void main(void)
{
exit(0);
}
(Yes, I know, my code sample is ridiculous )
Thanks
~RaGE();
|
|
|
|
|
You'll need this too:
#include <process.h>
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Does not work either. (Actually, MSDN says process or stdlib).
~RaGE();
|
|
|
|
|
... added some libraries in the linker tab and it works.
Thxx
~RaGE();
|
|
|
|
|
This code compiled without any errors in VC6:
#include <stdio.h>
#include <process.h>
int main()
{
exit(0);
printf("dfdfghdf");
return 0;
}
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
hi!all
on windowsXP progress bar is not getting refreshed..my same code runs fine on win98.can somebody help me out.
thanks in advance.
--Shiben.
shibenOL
|
|
|
|
|
What do you mean with not getting refreshed ? Does it display anything at all ?
~RaGE();
|
|
|
|
|
Hi!Rage
Thanks for looking into the thing.
my progress bar is getting displayed well but if i change the focus to some other object and come back again to this progress bar it stops(getting refreshed i guess)otherwise on win98 the same code works very fine.
Thanks and Regards'
--Shiben..
|
|
|
|
|
I have tried to determine if a field is PK (primary) or FK (foreign key) but not much luck. One constraint: this must be done ADO/C++.
I'm almost completing my module now... a short code sample in C++ will definitely help a lot...
Basically,
pRs->Fields->Item[j]->get_Name(&bstrFieldName); //This is how I retrieve field name.
nType = pRs->Fields->Item[j]->Type; //This is how I retrieve data type.
But how can you determine if a field is PK/FK??
Help!
Reference:
http://www.codeguru.com/forum/showthread.php?s=&postid=634066#post634066
norm
|
|
|
|
|
hi, i need to identify database schema. Some people suggested to use OpenSchema.. but i've no idea how to use this API from VC. All samples are in VB.
So, I did the following:
char szPK[20];
strcpy(szPK, (pRs->Fields->Item[j])->Properties->Item["KEYCOLUMN"]);
This doesnt work of course. But it illustrates the intention is to determine:
(a) Given a field, is it a "Primary Key" OR "Foreign Key"
(b) And "After" identify that a field is a foreign/primary key, determine the "associated: table.
Thanks
norm
|
|
|
|
|
Hello,
I just added UNICODE support to my App and it fails to work properly. Even simple string assignments fail, I always end up with one (the first) character.
example,
<br />
CString s;<br />
s = _T("Test");<br />
Now s seems to be 'T'. What's going on here?
|
|
|
|
|
Try defining both UNICODE and _UNICODE in the predefined macros section.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I think the problem is in your output of the value. There are two things to remember:
1. Unicode handling is mostly limited to NT/2000 platforms.
2. If you use an ansi string function on a unicode string you will (very often) see that the function gets only the first byte of the 2 byte character. That is because the second byte is often 0x00.
You say that you have added UNICODE support, does that mean that you have defined UNICODE?, then perhaps you could try defining _UNICODE as well.
"After all it's just text at the end of the day. - Colin Davies
"For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus
|
|
|
|
|
I suggest you have a look at Michael Dunn's string articles from here[^] and here[^]
Best regards,
Alexandru Savescu
P.S. Interested in art? Visit this!
|
|
|
|
|
van Padoea wrote:
Now s seems to be 'T'. What's going on here?
Did you see this in the debugger?
Check the "Tools/Options/Debug/Display unicode strings" option
My latest article:
SQL Server DO's and DONT's[^]
|
|
|
|