|
AFAIK You should pass automation-compliant types to Javascript code.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Just have a look at this [^]
Величие не Бога может быть недооценена.
|
|
|
|
|
hello Friends
I created a win32 based .exe tht is just reADING A TEXT FILE and deleting the file tht whatever is in tht text file but after deletion of all the files tht exe is still running in process.How can i stop that?
Thanks & Regards
Yogesh
|
|
|
|
|
Why the reading-and-deleting process doesn't terminate after its task is complete?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I m not reading and deleting the process.I m reading some files and deleting it thru exe and tht exe is not getting deleted after finishing.
|
|
|
|
|
yogeshs wrote: I m not reading and deleting the process.I m reading some files and deleting it thru exe and tht exe is not getting deleted after finishing.
OK. I've already got this point. What I meant was: "have you control (i.e. the source) of the executable that reads and deletes files?" and: "cannot the executable that reads and deletes file just exit, after its task is accomplished?".
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hey I got it.Thx for ur valuable time to solve my prob.I just ExitProcess(0)and it works.
|
|
|
|
|
yogeshs wrote: I just ExitProcess(0)and it works.
It rather appears to work... Can't you just return 0 (if it's the main function of a console app) or Post a WM_CLOSE to your app (if it's a windowed app) instead?
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
How's life moving and happy Diwali to you and your family..
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Happy Diwali (whatever it is... I'm cheating: Wikipedia helped me about... ) to all you Indians (and Nepali)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
Life's going on, Alok. Thanks, and wish you and your family too a very happy Diwali.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
Hi yogeshs,
Is your application multi-threaded?
Best Wishes,
-David Delaune
|
|
|
|
|
Post WM_CLOSE message to main window of your application.!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
or call API PostQuitMessage()
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
ThatsAlok or call API PostQuitMessage()
Yes, and he still needs to break out of the message pump loop when this condition is recognised.
|
|
|
|
|
Hi, i hav made a mdi project in vc++ 6.0. Now i want to create a dll for this whole project. I hav searched on net but found only examples which show how to make dll for few methods. How can i create a dll for whole project including all classes?
|
|
|
|
|
I don't really understand what you are trying to do . You want to convert your exe into a dll ? For what reason exactly ?
|
|
|
|
|
Cedric Moonen wrote: You want to convert your exe into a dll ?
Someone must have written an article about this, or there is a rogue teacher somewhere. I keep coming across questions where developers think that their application should be a DLL rather than EXE. Then they want to start it from a console app and let it run independently.
|
|
|
|
|
As suggested by the name, a DLL is a library (of functions or classes). So, generally speaking your question doesn't make sense (i.e. is your whole project just a collection fo reusable functions or classes?).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
So, you succeeded in exporting functions, but don't know how to export classes from a DLL? See DLLs are simple: Part 2[^]
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
I'm getting the below exception and code given below.
Exception : "Windows has triggered a breakpoint in WBEventsSheetCalculate.exe.
This may be due to a corruption of the heap, which indicates a bug in WBEventsSheetCalculate.exe or any of the DLLs it has loaded.
This may also be due to the user pressing F12 while WBEventsSheetCalculate.exe has focus.
The output window may have more diagnostic information."
Any help is appreciated. Thanks in advance.
Excel::_ApplicationPtr xl;
Excel::WorkbooksPtr bookPtr;
class ExcelBookEventHandler : public IDispEventSimpleImpl<1, ExcelBookEventHandler, &__uuidof(Excel::WorkbookEvents)>;
{
BEGIN_SINK_MAP(ExcelBookEventHandler)
SINK_ENTRY_INFO(1, __uuidof(Excel::WorkbookEvents), 0x0000061b, &ExcelBookEventHandler::SheetCalculate, &SheetCalculateInfo)
END_SINK_MAP()
void _stdcall SheetCalculate(IDispatch *pDisp)
{}
}
std::vector<excelbookeventhandler> bookHandler;
class ExcelAppEventHandler : public IDispEventSimpleImpl<1, ExcelAppEventHandler, &__uuidof(Excel::AppEvents)>
{
public:
ExcelAppEventHandler(bool& doneFlag) : done_(doneFlag)
{
done_ = false;
}
// The sink map maps event handler functions to the events they handle
BEGIN_SINK_MAP(ExcelAppEventHandler)
SINK_ENTRY_INFO(1, __uuidof(Excel::AppEvents), 0x0000061f, &ExcelAppEventHandler::WorkbookOpen, &WorkbookOpenInfo)
END_SINK_MAP()
// When I create new excel workbook, this event gets fired.
void _stdcall WorkbookOpen(Excel::_Workbook *book)
{
ExcelBookEventHandler calc;
bookHandler.push_back(calc);
int val = xl->Workbooks->Count;
bookHandler[val-1].DispEventAdvise(book);
cout<<"Inside Workbook Open";
}// here, I'm getting the exception
int _tmain(int argc, _TCHAR* argv[])
{
CoInitializeEx(0, COINIT_MULTITHREADED);
{
if (SUCCEEDED(xl.GetActiveObject(__uuidof(Excel::Application))))
{
bookPtr = xl->Workbooks;
if(bookPtr)
{
bool flag=true;
BookCount = bookPtr->Count;
for(int i=1 ; i<=BookCount ; i++)
{
BookName = bookPtr->Item[i]->Name;
ExcelBookEventHandler calc;
bookHandler.push_back(calc);
}
}
}
for (int i=1 ; i<=BookCount ; i++)
{
bookHandler[i-1].DispEventAdvise(xl->Workbooks->Item[i]);
}
ExcelAppEventHandler handler(done);
if(SUCCEEDED(handler.DispEventAdvise(xl)))
{}
}
CoUninitialize();
return 0;
}
|
|
|
|
|
You really need to format your code using the <pre></pre> tags. Clicking 'code block' above the edit box when posting will do just that with selected text.
Have a look before you're posting code in order to verify that it looks as it should. You have used the std::vector template, but the template arguments are lost since they have been interpreted as HTML tags so the rest of us cannot figure out whether the map contains ExcelBookEventHandler objects or references to such objects.
North 2009 wrote:
void _stdcall WorkbookOpen(Excel::_Workbook *book)
{
ExcelBookEventHandler calc;
bookHandler.push_back(calc);
int val = xl->Workbooks->Count;
bookHandler[val-1].DispEventAdvise(book);
cout<<"Inside Workbook Open";
}
You've got to think this through....
You're creating an ExcelBookEventHandler object on the stack and adding it to the map; now it's really interesting whether the map holds real objects or references. The local ExcelBookEventHandler object will be destroyed when execution returns from WorkbookOpen() .
What does the call stack look like when you get the exception?
North 2009 wrote:
CoInitializeEx(0, COINIT_MULTITHREADED);
Why?
Are you really using multiple threads from a COM perspective? I would guess that you're not since nothing in the code you've posted suggests that you are.
What happens if you change this to using an ordinary STA instead, e.g.
::CoInitialize( NULL ); or
::CoInitializeEx( NULL, COINIT_APARTMENTTHREADED ); ?
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Hi all, I ahve 2 questions.
First:
I would like to know how to convert the text from file into the format below.
In my program,
UINT Test_a(LPVOID lParam)
{
CStdioFile f1(_T("C:/abc/t1.txt"), CFile::modeWrite|CFile::OpenFlags::modeCreate|CFile::shareExclusive);
CString f1_txt;
......
f1_txt.Format("%le %le %le\n", x, y, z);
f1.Write(f1_txt, f1_txt.GetLength());
.....
f1.Close();
}
UINT Test_b(LPVOID lParam)
{
CStdioFile f2;
f2.Open((_T("C:/abc/t1.txt"), CFile::modeRead | CFile::shareExclusive);
CString rdtxt;
//how to read the text from the file t1 and convert it to "%le %le %le\n", &x, &y, &z format?
Can i do something like this?
while(f2.ReadString(rdtxt) != NULL)
{
rdtxt.Format("%le %le %le\n", &x, &y, &z);
....
}
f2.Close();
}
Second:
For CFile.Read. When i put CFile::shareExclusive in my f1.Open, i will have error. The error is
Debug Assertion Failed!
Program: c:\Documents and settings\...\GUi.exe
File:f:\dd\vctools\crt_bld\self_x86\crt\src\fscanf.c
Line:52
Expression:(stream != NULL)
When i change shareExclusive to shareDenyNone or shareDenyWrite, then the program work. How can i solve this? I don't other to open the file when i am running/using the file in my C++ program. The file is quite big, about 8M.
My program code:
text.txt file is created above my program using CStdioFile f2(_T("C:/abc/test.txt), CFile::modeWrite|CFile:shareExclusive);
CStdioFile f1;
CString rd;
CString output;
f1.Open(_T(C:/abc/test.txt"), CFile::modeRead | CFile::shareExclusive);
while(f1.ReadString(rd)!= NULL)
{
output += rd;
output.Format("%lf %lf %lf\n", &a, &b, &c);
.......
.......
}
f1.Close();
Thanks for helping out.
modified on Wednesday, October 21, 2009 1:03 AM
|
|
|
|
|
Nicholas Amh wrote: //how to read the text from the file t1 and convert it to "%le %le %le\n", &x, &y, &z format?
Can i do something like this?
while(f2.ReadString(rdtxt) != NULL)
{
Ya you can use the _tscanf() function.
_tscanf(rdtxt,_T("%lf %lf %lf\n"), &a, &b, &c));
|
|
|
|