|
MKC002 wrote: How to solve this problem. Use Excel automation instead, where the password can be provided to the Open() function.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
I want to open excel file contents in my own window, not in excel window. Is that possible with excel automation?
|
|
|
|
|
MKC002 wrote: Is that possible with excel automation? Yes.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Thanks for confirmation
Is there any example available in VC++
Can you please give some link
|
|
|
|
|
|
I want to ask you something, from yours experience : how is the fastest way to handle data (1 - 10 000 items) ?
In serialized CMap object ? Or in xml file ? I want to simulate 3 - 4 SQL tables, but I don't want to keep it into database ... I work in VC6 (MFC). Thank you.
modified 1-Jun-12 5:42am.
|
|
|
|
|
Hash list is generally quickest, unless you can sort the data.
If you are going to be reading-writing to file though it doesnt really mater whet the structure is in memory snce the speed bottleneck will be the disk access.
==============================
Nothing to say.
modified 2-Jun-12 2:53am.
|
|
|
|
|
If your program isn't something that has to stay closed source you could try using Berkeley DB[^], I've found it works really well for simple DB style apps.
If you can't or won't go open source for whatever reason I've found (for me, your data may be used in a completely different fashion) that a two layered approach for fast disk data access works best:
- the data itself is stored in a file with fixed size records
- another file containing a sorted or hashed index of key against index in the data file
Generally I read the index into memory, bung it in a vector or map . When I need data I look the index up in the map and hit the disk for the data itself.
|
|
|
|
|
Very good ideea, I never use map from STL, I play only with CMap from MFC, and I like it ...
|
|
|
|
|
Flaviu2 wrote: I never use map from STL, I play only with CMap from MFC
You should rather do the opposite.
Veni, vidi, vici.
|
|
|
|
|
Yeah, STL is highly optimised. And highly used....
==============================
Nothing to say.
|
|
|
|
|
STL's map is implemented as a tree, which isn't as fast as hashing. MFC's CMap... classes and STL's hash map use hashing, so should be used if speed is the top goal.
"Microsoft -- Adding unnecessary complexity to your work since 1987!"
|
|
|
|
|
Hi,
is it possible to call web service from java script? if so how to call. please provide me answer
|
|
|
|
|
You should try this link. [^]
Every new day is another chance to change your life.
|
|
|
|
|
You do realise this is a C++ group, with a strong bias to MFC?
There is a java and a javascript forum on codeproject too.
Good luck,
Iain.
I am one of "those foreigners coming over here and stealing our jobs". Yay me!
|
|
|
|
|
Hi,
I have a CWinThread::run overidable that is generating a division by zero at a call to IsIdleMessage which I cann't for the life of me figure out why
Any insight is appreciated
<pre lang='cpp'> int SockCLeintThread::Run()
{ ASSERT_VALID(this);
MSG m_msgCur;
// for tracking the idle time state
if (!flags.is_connected)
return TRUE;
BOOL bIdle = TRUE;
LONG lIdleCount = 0;
// acquire and dispatch messages until a WM_QUIT message is received.
for (;;)
{ phase1: // check to see if we can do idle work
while (bIdle && !::PeekMessage(&m_msgCur, NULL, NULL, NULL, PM_NOREMOVE))
{ // call OnIdle while in bIdle state
if (!OnIdle(lIdleCount++))
bIdle = FALSE; // assume "no idle" state
} // phase2: pump messages while available
do { // pump message, but quit on WM_QUIT
if (!PumpMessage())
return ExitInstance();
// reset "no idle" state after pumping "normal" message
<b>if (IsIdleMessage(&m_msgCur))<=== code causing exception </b> bIdle = TRUE;
lIdleCount = 0;}
} while (::PeekMessage(&m_msgCur, NULL, NULL, NULL, PM_NOREMOVE));
}
ASSERT(FALSE); // not reachable
} </pre>
|
|
|
|
|
have you overridden IsIdleMessage ?
|
|
|
|
|
|
Why are you overriding CWinThread::Run() anyway? I don't see anything in your code that would require you to do this.
|
|
|
|
|
I am overriding it because I want to use PostthreadMessage and am using the code to create aa mesaage queue
|
|
|
|
|
Hi,
All my exceptions Were occurring in CWinThread::Run Being an Assembler programmer I went into Assembly mode to try and debug it
However the optimizer made things crptic
I then proceeded to use the #pragma to turn off optimization after doing this however the exceptions disappeared
Thanks Again
|
|
|
|
|
You don't have to override Run() to use PostThreadMessage() , and you also don't have to manually create a message queue.
|
|
|
|
|
Hello!
In my current project I'd like to have some additional std::string functions, like trim[r/l], to_lower/to_upper, split and stuff like that.
I know that inheriting from std::string borders on heresy, but I am not sure what else I should do.
I could make a file like strtools.h where all the functions I want are defined but that does not fit the OO scheme of std::string and C++ in general.
Or I could make a class that does not inherit from std::string but privately uses a variable of that type. That would obey OO rules but it's heck of a lot work to do and I guess there will be some overhead (I haven't tested it yet, so hopefuly you can tell me)
What would you recommend me to do and why?
Thanks in advance.
modified 31-May-12 9:29am.
|
|
|
|
|
i usually do it with global (non-class) functions. it's cleaner than going through all the ridiculous hassle of extending std::string.
|
|
|
|
|
Be sure to look at Boost String Algorithms Library[^]. It already does what you want, and even if you don't want to use it directly, there is a lot to learn from there.
|
|
|
|