|
USAFHokie80 wrote: so then the "regular dll that uses MFC" can't contain classes?
it can contain them, sure. you can even export them: (for example).
but if you want to export C++ classes, you'll really should use an MFC extension DLL. most importantly, this ensures that the app and the DLL are using the same heap for memory allocation - don't want to pass a CString which has allocated memory into a DLL which is looking at a different heap...
or, as MS puts it: "If you need to pass an MFC or MFC-derived object pointer to or from an MFC DLL, the DLL should be an extension DLL."
|
|
|
|
|
Ah. That makes more sense. I don't use DLLs really, so that's probably the problem here. Just trying to figure out the difference so that I can start using them correctly.
|
|
|
|
|
Here's another link (very close to Chris' first link)...
Kinds of DLLs[^]
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Chris Losinger wrote: but if you want to export C++ classes, you'll really should use an MFC extension DLL.
If the DLL uses MFC otherwise a simple DLL will suffice.
|
|
|
|
|
Hi,
I want to add drop shadow to a child window...
please help me.
thank you.
Every new thing you learn,Gives you a new personality.
|
|
|
|
|
I will assume you're using MFC:
BOOL CShadowDlg::OnInitDialog()
{
CDialog::OnInitDialog();
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}
SetIcon(m_hIcon, TRUE);
SetIcon(m_hIcon, FALSE);
::SetClassLong(
GetSafeHwnd(),
GCL_STYLE,
::GetClassLong(GetSafeHwnd(), GCL_STYLE) | CS_DROPSHADOW
);
return TRUE;
}
Note that CS_DROPSHADOW requires a Windows version >= XP.
Note that after this code is run ALL dialogs will have shadows!
Steve
|
|
|
|
|
Is it possible to set drop shadow for controls ?
|
|
|
|
|
I don't think so. You could always implement this functionality yourself however.
Steve
|
|
|
|
|
I used this in my dialog, After that try to hide the dialog, Dialog is hiding but the shadow is not hiding. I am using ShowWindow(SW_HIDE).
|
|
|
|
|
Hi,
I'm implementing an simulator and the user interacts with an image reflected in a mirror. How can I do this reflection, how can I flip or change this 3d world?
I'm using C++ language with Opengl and OpenHaptics (Phantom Omni library).
Regards,
|
|
|
|
|
You would be better off reading the docs for OpenGL since your question is more related to interacting with the OpenGL graphic drivers than C or C++.
Waldermort
|
|
|
|
|
Hi,
I am trying to debug a dll project on VC++ 6.0. Dll file is loading dynamically in the executable (Win32 Console Application) by LoadLibrary API and calling functions by using function pointers. How can I debug this DLL file?
Thank you.
Orkun GEDiK
Senior SAP R/3 Basis and Development Consultant
ASTRON
|
|
|
|
|
You can specify a executable to be stared when you want to debug your dll. I don't remember exactly where it was for VC6 but it was somewhere in the project properties.
|
|
|
|
|
Hi Cédric,
I tried that method before, but didn't work. This is because, as I emphasised in the message, "DLL is loading by LoadLibrary API" in executable. Is there any other suggestion?
Thank you.
Orkun GEDiK
Senior SAP R/3 Basis and Development Consultant
ASTRON
|
|
|
|
|
In MSDEV take Build->Start Debug->Attach To Process. You can see the running process, from which u can select the application which loaded ur dll. open the cpp of ur dll and u can insert breakpoint and can debug.
Another way: On Process tab of Task manager right the exe application, which load the dll, and select debug. MsDEV will open, then u can insert break point on ur dll's cpp file and can debug.
AJay
|
|
|
|
|
At the entry point of your DLL include a api call to DebugBreak()
|
|
|
|
|
Thank you. Is there any way to see C code instead of assembly?
Orkun GEDiK
Senior SAP R/3 Basis and Development Consultant
ASTRON
|
|
|
|
|
Do you have the .PDB file generated during the build of the dll otherwise enable generation of debug info which can be for release or debug. Try using a DEebug build if you are struggling.
Try using WinDebug rather than Visual studio, allthough it does have a learning curve.
|
|
|
|
|
Thank you for your precious feedback. Of course, I have PDB file for executable and dll files. By using this file, can I debug dll file in WinDbg? If I can, how to?
Thank you.
Orkun GEDiK
Senior SAP R/3 Basis and Development Consultant
ASTRON
|
|
|
|
|
WinDbg has a symbol search path and a source search path. both of these need to be set up correctly. You can also download symbols for windows DLL's for various OS. You can also specify a debugger for any executable image which will get loaded automatically when the program executes. Very useful for debugging services.
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options"
create a key called "debugger" with a value like
"C:\Program Files\Debugging Tools for Windows\windbg.exe" -g
|
|
|
|
|
Hi Ajay,
I can't attach to the process, because of dll is calling at the begining of the fork.
Thank you.
Orkun GEDiK
Senior SAP R/3 Basis and Development Consultant
ASTRON
|
|
|
|
|
Hi,
I am trying to plot the wavform of wav file.In my case the wavfile consists of 6112 samples and having 8 bits per sample.byterate is 4395 bytes /s.Roughly it is equal to about 1.39 seconds of sample data.I want to plot this giving time on x axis and the sample amplitude on y axis.
I am not able to normalize such that 6112 samples can be represented on the scale of 0 to 1.39 seconds.Any hints or suggestions are welcome.
Regards,
Mayank
|
|
|
|
|
What exactly is your problem?
To calculate the X (-time) axis of the spectrum from the sample rate and the sample number?
time = samplerate * sampleno
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
To plot this properly you need to establish the range of values represented by each x-axis pixel and then plot a vertical line. Unless the plot area allows more than one pixel per sample.
struct Plot
{
int y_min;
int y_max;
}
samples_per_xaxis_pixels = number_of_samples / display_width;
Plot * plot_array = new Plot[ display_width / number_of_samples ];
for(int x=0,i=0;x<number_of_samples;i++,x+=samples_per_xaxis_pixels)
{
int y_min = INTMAX;
int y_max = -INTMAX;
for(i=x;i<x+samples_per_xaxis_pixels;x++)
{
plot_array[i].y_min = samples_array[x]<plot_array[i].y_min?samples_array[x]:plot_array[i].y_min;
plot_array[i].y_max = samples_array[x]>plot_array[i].y_max?samples_array[x]:plot_array[i].y_max;
}
}
And then plot it !
|
|
|
|
|
Hi,
Thanks for your reply.Actually in my case the samples=6112(with wach sample amplitude value between 0 and 255) and on x axis i have to represent these 6112 samples in a total of 1.39 seconds.Roughly if i divide x axis into parts of 100 ms then there are 13 such parts in which i have to divide 6112 samples,so if the display_width in the above case comes out to be 13 .
Thanks and Regards,
Mayank
|
|
|
|