|
My dll and exe were using MFC in a shared dll, so I guess there must be something else are wrong...
|
|
|
|
|
1. Go to Project/Settings
2. Click in the C++ tab.
3. Select the Code Generation category.
4. Verify the "Use run-time library" combo has the same thing for both of your projects.
Here's what I use for my projects:
Win32 Debug: Debug Multithreaded DLL
Win32 Release: Multithreaded DLL
Regards,
Alvaro
When birds fly in the right formation, they need only exert half the effort. Even in nature, teamwork results in collective laziness. -- despair.com
|
|
|
|
|
In the past I have had problems with..
=[ Abin ]= wrote:
AFX_EXT_CLASS
instead i use __declspec(dllexport) on the constructor/destructor and any functions I want to export.. Not sure if that has anything to do with your problem..
One other thing why "CString& str" in your dll function?
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
Hi,
I got a tricky deadlock, and I'm wondering if it's a good idea to process only individual messages.
What I would need to do is specifically pick and process WM_DEVICECHANGE messages from the message queue (without "killing" or processing other messages)
The PeekMessage documentation looks like it's possible (by providing a message range), but there's no discussion of it's implications. Any experience / documentation on that?
Problem at hand:
Communication with an USB device. When communication fails for any reason, the communication should try to recover and repeat the last transfer. This might involve a device reset, and reconnecting to the device.This should happen without knowledge of the caller.
To reconnect after a lost connection, I need to enumerate devices to find the device with the same serial. Windows sends WM_DEVICECHANGE messages to announce the device removal and reconnection.
Problem: Win 98 waits ca. 20 seconds for these messages to be processed before it gives up. This means that the new device (although plugged in) is not enumerated systemwide for 20 seconds (unless I process messages or cancel the process). Not acceptable (just to long).
The communication has no knowledge about the hosting application, and the hosting application can't easily process messages while transfers are pending (but it can't timeout for 20s)
Italian is a beautiful language. amare means to love, and amara bitter.
sighist | Agile Programming | doxygen
|
|
|
|
|
What framework do you use? (MFC, ATL, Win32 API?)
|
|
|
|
|
void DoEventsEx(UINT wMsgFilterMin, UINT wMsgFilterMax)
{
MSG msg;
while ( ::PeekMessage(&msg, NULL, wMsgFilterMin, wMsgFilterMax, PM_NOREMOVE ) )
{
if ( ::GetMessage(&msg, NULL, wMsgFilterMin, wMsgFilterMax))
{
::TranslateMessage(&msg);
::DispatchMessage(&msg);
}
else
{
break;
}
}
}
|
|
|
|
|
Hi,
I am building a wind synth that uses the API midi functions of
a soundcard. m_Note2 is an int value according to the keys pressed
and m_PBAD_2 is an int value ranging from 0-127 according to the airflow
thru the synth, updated according to the timer set at 250 millisec.
When I blow into the synth a note is played every 25sec but does not
stop, because the m_note in stopnote() outdated.
I have no idea what to add to the playnote() function. Any suggestions appreciated,
my knowledge of VC++ is very limited.
Cheers,
Rob
robert.harrington2@mail.dcu.ie
void CAD_mouthDlg::PlayNote()
{
UpdateData(TRUE);
MidiOutMessage (hMidiOut, 0x00, 0x90, m_Note2,m_PBAD_2) ;
}
void CAD_mouthDlg::StopNote()
{
if(m_Key_Press == FALSE)
{
MidiOutMessage (hMidiOut, 0x00, 0x90, m_Note2,0) ;
}
else
{
}
}
void CAD_mouthDlg::OnTimer(UINT nIDEvent)
{
CAD_mouthDlg::read_analog();
CAD_mouthDlg::SetPortChigh();
CAD_mouthDlg::OnButtonReadPort();
CAD_mouthDlg::PlayNote();
CAD_mouthDlg::StopNote();
CDialog::OnTimer(nIDEvent);
}
|
|
|
|
|
Hi
I am looking for the Automation of Ms Office Files (.doc, .xls, .ppt). So that the software shoudl be able to convert the documents into single or multiple page(s) HTML format. MS Word, MS Excel, MS Powerpoint, Visio and jpeg/gif format documents should be supported using VC6. The conversion of document should be able to take into account the layout scheme of the website and be able to embed the converted pages in the layout scheme of that particular website. How can i achieve this target? Can anyone help me out of this trouble?
I'll be realy grateful.
Thanx.
|
|
|
|
|
Ello
Anyone knows how i can easily disable a tab in a propertysheet without having to subclass the CPropertySheet?
i'm now using, when a condition is true, i just remove that page so you can't see it. That's already a good solution. The tab disabling looks even better tho
Greetings
Jens
|
|
|
|
|
Maybe you could use CPropertyPage::Create to create the page and set the style WM_DISABLED (2nd paameter).
~RaGE();
|
|
|
|
|
In my SDI application I have to write some text
in the View. I use TextOut function and it works fine
using a Default font size and type (I suppose).
I'd like to change font size and type. Is it
possible ?? How ??
Thanks a lot !!!
|
|
|
|
|
Could you use a CStatic for your Text? CP has plenty of information about CStatic.
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
My View is not a CFormView derived class.
I'dont know if it is possible to create a CStatic control in
a CView derived class. But I'd prefer to don't use a a CStatic
control if it is possible...
Text I have to draw changes continously position in my View and
must be often created and destroyed so I think that it could be
more easy to use TextOut function...
But.. how to change font type and size ???
The only why is to create and manage CStatic controls ??
|
|
|
|
|
I have followed your message... and I have created
a CStatic control in my View.
It can be good !!! So I can use a derived class from
CStatic in order to change all parameters...
Now, I have another problem...
when my View is repainted the CStatic control is drawn
again (I suppose) and it blinks.
How can I solve this problem ??
Thanks a lot !!!
|
|
|
|
|
You have to draw it first in memory and, when it's done, you push it on the screen.
Use CreateCompatibleDC to create the memory dc compatible with the screen dc. Then draw your image on this device context, and, when it's done, send it to the screen dc using the BitBlt method (bitmap copy).
|
|
|
|
|
Use SelectObject() API function giving second parameter as HFONT
C.R.Naik
|
|
|
|
|
Hello
I'm trying to get the Ok/Cancel buttons to work with a modeless property sheet.
I've managed to get all buttons to show by overriding OnInitDialog() (I'm using the CTreePropSheet availible on this site)
BOOL CSettingsSheet::OnInitDialog()
{
m_psh.dwFlags &= ~PSH_HASHELP;
m_psh.dwFlags &= ~PSH_NOAPPLYNOW;
m_bModeless = FALSE;
BOOL bResult = CTreePropSheet::OnInitDialog();
m_bModeless = TRUE;
return bResult;
}
All buttons are shown despite of the dwFlags changes. How can I get rid of the apply/help buttons?
Thanks
|
|
|
|
|
In the Sheets constructor, before any of the pages are constructed, I call this:
m_psh.dwFlags |= PSH_NOAPPLYNOW;
m_psh.dwFlags &= ~PSH_HASHELP;
< edit > And here is what I do in the beginning of OnInitDialog
m_bModeless=FALSE;
m_nFlags |= WF_CONTINUEMODAL;
BOOL bResult = CPropertySheet::OnInitDialog();
m_bModeless= TRUE;
m_nFlags &= ~WF_CONTINUEMODAL;
< /edit >
Stop asking why - I just copied it from someone, and as it worked I never bothered to think about it again.;)
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
I have dragged and dropped the progress bar control on a dialog and have also declared it's variable. Now I want to show increments in the progress bar in a loop. What would be the method of doing so.
Reply me soon
|
|
|
|
|
First you have to tell the low and high ranges with the SetRange( short nLower, short nUpper ) method. You can also specify a step increment with the SetStep( int nStep ) method.
For showing a new progress use the StepIt( ) method.
Take a look at the MSDN documentation. Everything is described there.
|
|
|
|
|
hey guys, good day.
i can view my database in visual c++ by ADO but one thing is that it not user-friendly. i have to click the navigating btn find the ID i want.
So i wanna have a search function like using titleid to search the thing i want. It like that, i key the no. 40 for titleid then click search. How should i start the code for search thanks.. alot
|
|
|
|
|
Hi,
I am facing problem with the richtext control. When you save the content with the bullet format, it works but when the same content is extracted from database format is totally lost instead certain unnecessary dot appears?
Help me out !
satan
|
|
|
|
|
My dialog box contains many edit boxes and hence i want to write a general class which inherits from CEdit and allows the user to enter only numeric characters.Please some one advice me on how to implement this.I implemented this to a certain extent where it can control the characters typed but it cannot control the characters entered by pasting into the edit box
|
|
|
|
|
If you use the ES_NUMBER style for the edit box, it only accepts digits.
|
|
|
|
|
i had the same problem about the pasting thing ... i simply fixed that problem
just catch the wm_paste message, open clipboard, clear clipboard en close clipboard.
Hereby noone can paste anything in your edit fields
so you get better control
ehehe
|
|
|
|