|
Hello I was wondering if anyone out there has done any work with "waveform" functions? I have created and app the records, play's and pause's audio. Trying to get the audio to loop, seem to be having a little trouble specifying last chunck before loop starts again. MSDN say's to change the begin_loop and end_loop flags after prepareheader but before writing the chunck, this did not work for me set I set the flags before the prepareheader which worked but MSDN says that the flag param has to be zero for prepareheader to pass. Seems MSDN is incorrect. Does anyone have any knowledge in this area???
Help is ver appreciated.
Tracy
|
|
|
|
|
When I use the CMyAppDlg::m_hIcon icon the icon is big in the status bar... do I have to use a small or is there a code to make it small??
/*
BETA
*/
|
|
|
|
|
Rickard
unfortunately I do not have an answer for this, but a few observations that might help you to figure it out.
When you say the icon is big I assume that this is the 32 x 32 icon when you will be needing to display the 16 x 16 icon. CStatusBarCtrl::SetIcon doesn't seem to have any way to choose the icon size, and OnInitDialog uses CWnd::SetIcon to set the 32 x 32 and the 16 x 16 icon. CWnd::SetIcon returns a HICON so maybe if you create a member variable m_hSmallIcon and in OnInitDialog change the line to m_hSmallIcon = SetIcon(m_hIcon, FALSE) you can then use m_hSmallIcon in the call to CStatusBarCtrl::SetIcon.
Hope this helps.
Michael Martin
Pegasystems Pty Ltd
Australia
martm@pegasystems.com
+61 413-004-018
|
|
|
|
|
I'm trying to write a VB (yes, that's Visual Basic) Add-In using ATL. I've #import'ed MSO97.DLL and VB6EXT.OLB. Everything seems to compile fine, except for the following error:
error C2786: 'long (__stdcall *)(struct HWND__ *,void *,char *,struct _devicemodeA *,struct _devicemodeA *,unsigned long)' : invalid operand for __uuidof
This error refers to the following line, found in the created 'mso97.tlh' file:
_COM_SMARTPTR_TYPEDEF(DocumentProperties, __uuidof(DocumentProperties));
I've tried commenting out this line (since I have no intention of using DocumentProperties anyway), but it's re-inserted by the #import statement when I compile. If I remove the #import statement, and replace it with '#include "mso97.tlh"', then compiling fails miserably. Any ideas? I only desire access to the CommandBar and CommandBarControl interfaces.
Thanks in advance.
Jamie Nordmeyer
Portland, Oregon, USA
|
|
|
|
|
OK, I noticed another thing. The GUID for DocumentProperties, as well as the DocumentProperties name itself, do not exist anywhere in my registry.
Jamie Nordmeyer
Portland, Oregon, USA
|
|
|
|
|
Try specifying that you only want the interfaces and not all the extra junk. In VC++ it looks like this: #import "mso97.dll" raw_interfaces_only
I'm not sure how to do it in VB as I am strictly VC++.
Bret Faller
Odyssey Computing, Inc.
|
|
|
|
|
Hi all,
I want to know, can i make a report by Crystal Report 7.0 with deafult SQL query, that i'll can change the query in my program(run-time changing ...) ???
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
No...
Because the Crystal Report, take the fields from the General Query.
You can change the value of the parameter but not the query.
But you can make a Stored procedure that always returns the same fields, but this stored can make diferents querys depending the parameters, for example.
Good Luck!!!
Carlos Antollini.
|
|
|
|
|
Hi Carlos,
Yesterday, my friend said to me: "you can use of this: crystalreport1.sqlquery = "SELECT * FROM T1""
Of course, it is in VB ..
I want to know can i use of it in VC++ ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
I am trying to start an exe app from a dll. I've used both WinExec(..) and CreateProcess(..) with no results. Is it at all possible to call an exe from a dll and if so, is there another way to do this? Please help me
Junior
|
|
|
|
|
Try the spawnxx famaily of calls
_spawnvp(_P_WAIT, tool, argv);
refer msdn.microsoft.com for exact desc.
|
|
|
|
|
CreateProcess should work, even from within a DLL. All you have to do is wait for the DLL's initialization process to finish before calling CreateProcess.
I'm willing to bet that you're setting the first parameter to the path\filename of the program you're running, too. Try combining the path\filename with your commandline parameters (if any) and pass the whole shooting match as the *2nd* parameter (make the 1st parameter NULL). Also, if you're using a CString to build the commandline, cast it to an LPCTSTR like so:
CString sMyCmdLine = "C:\myfolder\myprogram.exe /param1 /param2";
CreateProcess(NULL, (LPCTSTR)sMyCmdLine,....);
|
|
|
|
|
I had an eariler issue dealing with DAO access causing a program to crash. Apparently installing MDAC and DAOSDK solves that issue. (thanks to those who helped on this matter ) However now I am noticing a problem with COM, more specifically MSFLEXGRID. I have a MSFLEXGRID control in the program and I am noticing that within the main window it is not showing up and within a dialog box it is causing the program to crash long before it paints.
Are there more installs that need to happen?
I noticed this all worked when I had VC++ installed.
Thanks!
Chris
"Why are we hiding from the police, Daddy?"
"We use VI, son. They use Emacs."
|
|
|
|
|
I would like to use ADO to keep database record in excel sheet. But I don't know how to do that. And the second step of my problem is of being able to compare value in the database to one given in a dialog box. In fact I'm building an automation which need to catch good value into a database according to a parameter given in my dialog box.
So if anybody could help me....
thanks
gerald
|
|
|
|
|
Througth a Excel ODBC Driver!!!
Good Luck!!
Carlos Antollini.
|
|
|
|
|
if i create a control programatically (after deriving from cedit or whatever), how can I make it appear in classwizard so I can then bind messages to it...?
|
|
|
|
|
You can't. However, you can use the DDV_ and DDX_ methods directly.
If you already know the ID's of the contorls, why would you wan't to create them programatically???
|
|
|
|
|
Excuse me for the language... but I'm an italian guy!
I'm learning C++... and I found this code to have the IP address of my client:
int IPAddress()
{
WSADATA wsa;
WSAStartup(MAKEWORD(1, 0), &wsa);
char* szBuffer = new char[250];
TCHAR *lpIPAddr = new TCHAR[250];
if(gethostname(szBuffer, 250) != 0)
return 0;
struct hostent * host = gethostbyname(szBuffer);
wsprintf(lpIPAddr, "IP Locale: %d.%d.%d.%d\n",
(BYTE)host->h_addr_list[0][0],
(BYTE)host->h_addr_list[0][1],
(BYTE)host->h_addr_list[0][2],
(BYTE)host->h_addr_list[0][3]);
return *lpIPAddr;
}
How can I use this code like a function? How can I insert this code in a Dialog that show IP Address? When I call it... what return it to me?
Thanks...
|
|
|
|
|
I made a couple of small changes, and now it works.
TCHAR* IPAddress()
{
WSADATA wsa;
WSAStartup(MAKEWORD(1, 0), &wsa);
char szBuffer[250];
TCHAR *lpIPAddr = new TCHAR[18];
memset(lpIPAddr, '\0', 18 * sizeof(TCHAR));
if(gethostname(szBuffer, 250) != 0)
return 0;
struct hostent * host = gethostbyname(szBuffer);
_stprintf(lpIPAddr, "IP Locale: %d.%d.%d.%d\n",
(BYTE)host->h_addr_list[0][0],
(BYTE)host->h_addr_list[0][1],
(BYTE)host->h_addr_list[0][2],
(BYTE)host->h_addr_list[0][3]);
return lpIPAddr;
}
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Anders... Thanks, thanks, thanks!!!
|
|
|
|
|
Fine, but remember to close WSA and deallocate memory allocated with operator new ( TCHAR *lpIPAddr = new TCHAR[18]; ). You should first initialize WSA, then create buffer, and lastly send it to the IPAdress function as an argument.
|
|
|
|
|
do you know any free sw to what when i give by me created xml file will say it is good/wrong formated one?
i afraid when i will use any-firma parser it can bring problem
(search at www.xml.org asks me i want to debug y/n)
t!
|
|
|
|
|
The sample programs of Xerces XML parser can be used as XML validators. It's available from xml.apache.org.
|
|
|
|
|
Hi everybody.
I have the following question. Is it possible to get behavour like this from templates.
template < typename T >
class TType
{
public:
CString GetAsString( )
{
CString sValue;
sValue.Format( GetFormat<t>( ), m_tValue );
return sValue;
}
protected:
T m_tValue;
};
Define some function that depended of the type will return different string for formating.
template < class int >
CString GetFormat( )
{
return "%d";
}
template < class float >
CString GetFormat( )
{
return "%.4f";
}
and then when this is used
TType< int > a; // will use template function for int
TType< float > a; // will use template function for float
|
|
|
|
|
It is invalid C++. Your idea written correctly looks like this:
template <typename t="">
class TType
{
public:
CString GetAsString()
{
CString sValue;
sValue.Format(GetFormat<t>(), m_tValue);
return sValue;
}
protected:
T m_tValue;
};
template <class t=""> CString GetFormat();
template <> CString GetFormat<int>() { return "%d"; }
template <> CString GetFormat<float>() { return "%.4f"; }
Unfortunately, this doesn't work on VC++ 6.0 (GetFormat<int> is called even for float's).
Try this:
template <typename t="">
class TType
{
public:
TType(const T& value)
: m_tValue(value)
{
}
CString GetAsString()
{
CString sValue;
sValue.Format(TypeHelper<t>::GetFormat(), m_tValue);
return sValue;
}
protected:
T m_tValue;
};
template <class t=""> class TypeHelper;
template <> class TypeHelper<int>
{
public:
static CString GetFormat() { return "%d"; }
};
template <> class TypeHelper<float>
{
public:
static CString GetFormat() { return "%.4f"; }
};
--
Martin
|
|
|
|