|
I have to develop a device driver for windows NT that will add a virtual audio device to the system. i need to hook up and capture the audio stream coming from microphone and send it to two differnt application. one sugesstion i got from Kakan is to develop a filter driver.
Now can a filter driver be used to install a virtual device.
there are MSVAD sample drivers in DDK. are thay filter drivers?
can i use those sample codes for my work.
saad
|
|
|
|
|
Hi,
I have a line that I want to key as follows:
m_Query.Format("select Route_ID
Stage_ID,
Price,
valid_from,
valid_to,
Price_Key
from TicketPrice
where Ticket_Type = '%s'
FOR UPDATE", m_selected_id);
However I get C2001 newline in constant messages from the compiler. Anyone know the line continuation symbol?
Ger
|
|
|
|
|
Ger Hayden wrote: Anyone know the line continuation symbol?
You can either use the backslash character like:
m_Query.Format("select Route_ID \
Stage_ID, \
Price, \
valid_from, \
valid_to, \
Price_Key \
from TicketPrice \
where Ticket_Type = '%s' \
FOR UPDATE", m_selected_id); or enclose each string in quotes like:
m_Query.Format("select Route_ID "
"Stage_ID, "
"Price, "
"valid_from, "
"valid_to, "
"Price_Key "
"from TicketPrice "
"where Ticket_Type = '%s' "
"FOR UPDATE", m_selected_id);
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Thanks David,
Both forms work perfectly
GER
Ger
|
|
|
|
|
I've built a fairly simple MFC project, dialog based, that talks to a USB GPS device. The program uses a second thread to receive data at a 1-second rate and display the information in text form. When a data packet is received, the worker thread sends a message to the DlgWindow to tell it to get the new information. The call is:
if (pThis->m_hWndPost)<br />
::PostMessage (pThis->m_hWndPost, pThis->m_nMessageID, 0, 0);<br />
This works correctly in the Debug version of the project. However, when the Release version is built, the second call to ::PostMessage() crashes. I've isolated that code, and if I don't call the message post, no problem (of course, the DlgWnd never gets the new data). If I trap the message at the responding function in the DlgWnd, it crashes.
One work-around: if I set the compiler options to build using the debug libraries, either stand-alone or with shared MFC DLL, the problem goes away. I can't find that I have any corrupted libraries (and no reason to suspect).
Has anyone ever seen this problem before? Any ideas what I'm doing wrong? Turning off optimizations has no effect, either.
Thanks,
Mike
|
|
|
|
|
In debug mode, compiler takes care of things like initialization.
Check if all variables used are properly initialized.
Use NULL check before using pointers.
This is just a try. I'm not sure , why crash is happening.
|
|
|
|
|
Hi EveryOne!,
I will add code later, but I am having a problem with member variables. As you will see in the code the variables are being created and ClassWizard recognizes them. However, when I try to access them in the .CPP file they aren't working (I can add events from class wizard for them). I.E. I copy the variable from it's definition in the header file place it where I need it in the .CPP file and place a . (dot) after it, but it does not provide me a list of member functions that should be available. It does nothing. There is one exception and that is the m_CalUICCombo it works fine. The m_FySelected (also a ComboBox) does not work? Following is the Header file followed by the .cpp file. To keep this post down I've only inserted the relavant parts. Has anyone every run into this problem and if so what did you do to fix it?
Many Thanks in advance...
Charlie
<br />
class CECalAppendixIForm : public CFormView<br />
{<br />
protected:<br />
CECalAppendixIForm();
DECLARE_DYNCREATE(CECalAppendixIForm)<br />
<br />
public:<br />
enum { IDD = IDD_APPENDIXI_FORM_VIEW };<br />
CComboBox m_FySelected;<br />
CLabel m_SelectedItemsLabel;<br />
CLabel m_AppendixILabel;<br />
CComboBox m_CalUICCombo;<br />
<br />
public:<br />
SYSTEMTIME ct;<br />
<br />
<br />
CImgViewerDoc* GetDocument();<br />
CString csHdrLine;<br />
public:<br />
<br />
public:<br />
virtual void OnInitialUpdate();<br />
protected:<br />
virtual void DoDataExchange(CDataExchange* pDX);
virtual void OnDraw(CDC* pDC);<br />
<br />
protected:<br />
virtual ~CECalAppendixIForm();<br />
#ifdef _DEBUG<br />
virtual void AssertValid() const;<br />
virtual void Dump(CDumpContext& dc) const;<br />
#endif<br />
<br />
afx_msg void OnCloseupCalUIC();<br />
afx_msg void OnCloseupFySelected();<br />
DECLARE_MESSAGE_MAP()<br />
};<br />
<br />
<br />
<br />
IMPLEMENT_DYNCREATE(CECalAppendixIForm, CFormView)<br />
<br />
CECalAppendixIForm::CECalAppendixIForm()<br />
: CFormView(CECalAppendixIForm::IDD)<br />
{<br />
}<br />
<br />
CECalAppendixIForm::~CECalAppendixIForm()<br />
{<br />
}<br />
<br />
void CECalAppendixIForm::DoDataExchange(CDataExchange* pDX)<br />
{<br />
CFormView::DoDataExchange(pDX);<br />
DDX_Control(pDX, IDC_FYSELECTED, m_FySelected);<br />
DDX_Control(pDX, IDC_SELECTITEMS, m_SelectedItemsLabel);<br />
DDX_Control(pDX, IDC_APPENDIXI, m_AppendixILabel);<br />
DDX_Control(pDX, IDC_CALUICOMBO, m_CalUICCombo);<br />
}<br />
<br />
<br />
BEGIN_MESSAGE_MAP(CECalAppendixIForm, CFormView)<br />
ON_CBN_CLOSEUP(IDC_CALUICOMBO, OnCloseupCalUIC)<br />
ON_CBN_CLOSEUP(IDC_FYSELECTED, OnCloseupFySelected)<br />
END_MESSAGE_MAP()<br />
<br />
#ifdef _DEBUG<br />
void CECalAppendixIForm::AssertValid() const<br />
{<br />
CFormView::AssertValid();<br />
}<br />
<br />
void CECalAppendixIForm::Dump(CDumpContext& dc) const<br />
{<br />
CFormView::Dump(dc);<br />
}<br />
#endif //_DEBUG<br />
<br />
CImgViewerDoc* CECalAppendixIForm::GetDocument()
{<br />
m_pDocument->IsKindOf(RUNTIME_CLASS(CImgViewerDoc));<br />
return (CImgViewerDoc*)m_pDocument;<br />
}<br />
<br />
void CECalAppendixIForm::OnDraw(CDC* pDC) <br />
{<br />
SetScrollSizes(MM_TEXT, CSize(1200,1200));
CImgViewerDoc* pDoc = GetDocument();<br />
pDoc->csHdrLine = "APPENDIX I";<br />
pDoc->UpdateAllViews(this);<br />
}<br />
<br />
void CECalAppendixIForm::OnCloseupCalUIC() <br />
{<br />
}<br />
<br />
void CECalAppendixIForm::OnInitialUpdate() <br />
{<br />
CFormView::OnInitialUpdate();<br />
<br />
CSize sizeTotal;<br />
<br />
sizeTotal.cx = 250;<br />
sizeTotal.cy = 100;<br />
SetScrollSizes(MM_TEXT, sizeTotal);<br />
<br />
m_SelectedItemsLabel.SetWindowText("There are No Input Item(s) required for this Appendix.");<br />
m_AppendixILabel.SetTextColor(RGB(0,100,130));<br />
m_AppendixILabel.SetFontName("Times New Roman");<br />
m_AppendixILabel.SetFontSize(14);<br />
m_AppendixILabel.SetFontBold(FALSE);<br />
m_AppendixILabel.SetFontUnderline(FALSE);<br />
m_AppendixILabel.ShowWindow(SW_SHOW);<br />
}<br />
<br />
void CECalAppendixIForm::OnCloseupFySelected() <br />
{<br />
<br />
}
Everything is Free... Until You Have to Pay for it...
Platforms Windows 2000/XP Professional using Visual C++ 6.0
|
|
|
|
|
Without having to wade through all of the code, are you having trouble with IntelliSense?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Let me see if I can make the problem a little more clear. When I go to my OnDraw function in the source file and put in m_CalUICCombo. I get a scrollable list box of the functions/variables I can access for that combobox. When I type m_FySelected. I do not receive the scrollable list box giving me those choices for that combobox. I hope this will make it a little more clear what I am having a problem with. So I am not sure if that would be a problem with intellisense? Any further advice would be appreciated.
Everything is Free... Until You Have to Pay for it...
Platforms Windows 2000/XP Professional using Visual C++ 6.0
|
|
|
|
|
Charlie Curtis wrote: So I am not sure if that would be a problem with intellisense?
It is. See if this helps.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Appreciate your time and effort. I followed the link and found the information very useful for future reference. however, for the problem I had today it turns out that my .ncb, .aps, and .clw files got corrupted. I deleted them and reopened my project rebuilt the class wizard and all is well. Thanks again for the info.
Charlie
Everything is Free... Until You Have to Pay for it...
Platforms Windows 2000/XP Professional using Visual C++ 6.0
|
|
|
|
|
Charlie Curtis wrote: ...my .ncb, .aps, and .clw files got corrupted. I deleted them and reopened my project rebuilt the class wizard and all is well.
Yes, that is a common problem, too.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Please forgive my bad English first.
I changed the number of arguments of one of exposed methods of an old MFC activeX control. Then I just can't call it any more either in VB or ActiveX Control Test Container.
Here are the steps:
1).
I built a MFC activeX control with one of its exposed functions requiring 1 arguments. I registered the control and built a test VB application and it was OK.
2).
Then I changed that function to having 2 arguments and built the control again. And I also registered it again.
3).
The I changed calling code in the test VB application accordingly. But it just failed to call the function by remind me "Invalid number of arguments".
Any help will be greatly appreciated!
|
|
|
|
|
I think I found an IMPORTANT message. It's a warning when I compile the new MFC control in VC 6.0:
: warning C4002: too many actual parameters for macro 'DISP_FUNCTION'
I think this the very reason of the problem. But I have manually changed the method declarations in all the places.
Why is there this compiling WARNING?
|
|
|
|
|
Michael Tang wrote: : warning C4002: too many actual parameters for macro 'DISP_FUNCTION'
It says you have added one additional parameter in macro defn.
Make your macro defn look like one following
DISP_FUNCTION(mycorntrolclass, "MyMethod", MyMethod, VT_EMPTY, VTS_PI4 VTS_PI4)
make sure you activex builds without any warning.
Add its reference to your client program again.
|
|
|
|
|
prasad_som, A thousand thanks to you!
You just hit it, Now it's solved by killing the redundant comma.
I had checked the macro difinition I changed for so many times, but I just omitted the comma.
|
|
|
|
|
my pleasure
|
|
|
|
|
We have added the stackwalker.cpp program to our application to generate callstack report.
This is working fine in the development environment and the stacktrace is getting created.
But when we copy the executable to a separate windows system where there is no development environment like visual studio installed, the stacktrace is not getting created. Is this error
due to some missing dll files in the isolated system where we dont have visual studio installed
or do we have to make some changes in the way we are compiling and building the application.
Any suggestions would be of immense help.
|
|
|
|
|
I have searching for hours now trying to figure this one out. I have a .NET dll, not my own, which I wish to import into my project. From what I have read, and I may be wrong, I need to import it as a COM object. So I have tried
#import "net.dll" which results in:
fatal error C1083: Cannot open type library file: 'net.dll': Error loading type library/DLL.
This leads me to believe that the dll has no type library. When I have included my own VB dlls using the same method, I have no problems, the .tli and .tlb files are generated.
Is there another way to do this?
|
|
|
|
|
You haven't yet created the Type library for the .NET DLL. To create a type library, you need to make use of the regasm.exe tool.
regasm.exe net.dll Also make sure you have set the [ComVisible(true)] attribute
|
|
|
|
|
You can't do .net programming with VC6.
The best you can do is make the DLL have a CCW (COM callable wrapper) and then VC6 will see it as just another COM server.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
Michael Dunn wrote: You can't do .net programming with VC6.
does that mean I can't code VB in VC either :p
The dll I am trying to use is from a sourceforge project which has been coded in C#. I do not have the means to compile from source therefore I have to download the precompiled version. So I suppose my question is, to make this work in my project, would I have to change anything within the .net dll?
|
|
|
|
|
Hi,
I'm trying to convert a C application written for Watcom's C/C++ compiler to Visual C/C++ and I'm getting a compile error on the file that contains some of the prototypes, yet I do not understand what went wrong and how it's different.
Here's the line from the prototype file:
LONG EXPENTRY fnwpMainWindow(<br />
HWND hwnd, UINT msg, WPARAM mp1, LPARAM mp2 );
EXPENTRY is defined as an _export APIENTRY, APIENTRY is defined as a WINAPI and WINAPI is defined as __stdcall.
The error I'm receiving is error C2143: syntax error : missing '{' before '__stdcall'
Any idea's why this is happening?
Thank you,
Glenn
|
|
|
|
|
gmhanna wrote: The error I'm receiving is error C2143: syntax error : missing '{' before '__stdcall'
So what is above the fnwpMainWindow() prototype?
What if you changed it to:
long _export __stdcall fnwpMainWindow(HWND hwnd, UINT msg, WPARAM mp1, LPARAM mp2 );
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Hi David,
Yes, fnwpMainWindow is the prototype. I changed it to what you have and I receive the same error.
Converting this does not seem to be a simple task...
Glenn
|
|
|
|