|
Hi CPians,
I'm facing the following problem : I have a MFC dialog app which automates Excel (using OLE automation). I'd like to change the format of a range of cell from "Standard" to "Text", or "Number". How do I achieve that ? I already have a LPDISPATCH on my range of cells, and I have tried using a Style type, but since OLE is really new to me , I get a little bit lost with functions returning only VARIANT and so ... so please, could anybody provide me a code snippet for changing the format of these cells ?
Thanks a lot ...
~RaGE();
|
|
|
|
|
oRange.SetNumberFormat(CComVariant("0.00"));
oRange.SetNumberFormat(CCOmVariant("@"));
Peter Molnar
|
|
|
|
|
Thank you very much, that helped. I expected it to be so complicated that I did not even think about trying something that simple ... Thanks a lot !
~RaGE();
|
|
|
|
|
i have tried it all ,
i was even able to establish a conversation with netscape
using NETSCAPE,NSShell,Netscape6 (different for different netscape versions)
but netscape never sends me the URL
please help
|
|
|
|
|
Hi,
I have a dialog based appliaction, Which was working fine. All of a sudden it started crashing at DoModal(). When i call DoModal() it send WM_DESTROY message. Could anyone please tell me what is wrong?
Regards
Neha
|
|
|
|
|
Please specify in detail , whether it is a Modal or Modeless dialog ,
and what do u mean by When u DoModal it sends WM_DESTROY message.
Abhishek Srivastava
Software Engg (VC++)
India ,Noida
Mobile no 9891492921
|
|
|
|
|
It is a Modal dialog.
What i mean is when i call DoModal(), it comes to OnDestroy() member function of the dialog window.
|
|
|
|
|
Press F9 on destroy, press F5 and then open the callstack and check what's happening
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
It crashes at:
hWnd = ::CreateDialogIndirect(hInst, lpDialogTemplate,
pParentWnd->GetSafeHwnd(), AfxDlgProc);
in DLGCORE.CPP
hInst,lpDialogTemplate has the proper values.
pParentWnd=NULL;
AfxDlgProc has some value.
After this it will go to OnDestroy() instead of OnInitDialog()
|
|
|
|
|
Can you call GetLastError and see the error string?
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Hi,
case 1
CDialog oCDialog;
if(oCDialog.DoModal()==IDOK)
{
}
case 2
CDialog *pCDialog;
pCDialog = new pCDialog;
|
|
|
|
|
|
Did u change the resource file just before it started crashing?
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
You are right. I had fixed the problem...
Thanks ......
|
|
|
|
|
what i meant by enumerting the cases was that if you do not create the dialog box within if condition then the WM_DESTROY will get generated and it will destroy you dialog box.
if you don't wanna use if condition to create a dialog box then you will have to allocate memory to the dialog box pointer with new opeator.
i hope this solves your prob.
|
|
|
|
|
What kind of controls do you have embedded in this dialog?
I seem to remember the need to initialize support for RichEdit Controls prior to their use in a dialog.
Best Regards,
Bill
|
|
|
|
|
Hi, everybody
I meet a problem
First
DWORD WINAPI CA::ThreadFuncSound(LPVOID lpParam)
{
DWORD dwResult=0;
Beep(800, 1000000);
return 0;
}
ThenCreat a thread to sound which is suspended
m_hThreadSound = CreateThread(
NULL, // no security attributes
0, // use default stack size
ThreadFuncSound, // thread function
(PVOID)this, // argument to thread function
CREATE_SUSPENDED|THREAD_ALL_ACCESS, // Start the thread with a suspend count of one
&dwThreadId);
And then Start the sound thread
ResumeThread(m_hThreadSound);
Sleep(100);
Now I want to stop the speaker to sound. I ever used SuspendThread(m_hThreadSound) or TerminateThread(m_hThreadSound,0), but they can't work well.
How can I solve this problem?
Appreciate for any suggestions!
|
|
|
|
|
Hi there
to terminate a thread
first call GetExitCodeThread() method passing the Thread Handle to it and DWORD reference.
DWORD exitcode
GetExitCodeThread(m_hThreadSound, &exitcode) ;
Now call TerminateThread(m_hThreadSound, exitcode);
actually u were commiting mistake by passing 0 as thread exit code in ur TerminateThread line.
Tell me if i solved ur prob
Abhishek Srivastava
Software Engg (VC++)
India ,Noida
Mobile no 9891492921
|
|
|
|
|
Thanks
But it does not work well yet.
It seems that this operation can not stop the speaker's sounding.
Have any other way?
|
|
|
|
|
Sir , u have passed 1000000 as a second param in Beep method , which means u have played a sound for almost 16 mins and this will block ur thread .
so instead of issuing a command for 16 mins,do it in a While loop
like this
while (true)
{
Beep(800,100);
}
return ;
Abhishek Srivastava
Software Engg (VC++)
India ,Noida
Mobile no 9891492921
|
|
|
|
|
it is not very good
for the soud souds off and on, interrupted
Is it better if uninterrupted ?
|
|
|
|
|
Could somebody help me? Any information on ID3v2 of the MP3 files and any information of ID3v1 of the WAV, OGG, WMA files is appreciated.
|
|
|
|
|
You should try googling for it first!
Anyway, ID3V2[^]
ID3V1[^]
and there's an article on this subject on CP .
Hope this helps
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
Thanks! Those files I have read but haven't found the info I need. Have you some info on how to read the ID3v2 of the MP3 file? Or the structure of the ID3v2?
|
|
|
|
|