|
Hi all,
i want to use SPropValue struct in my code here a member Value that is union,i want to know all possible values of
Value.lpszW, like _T("SMS") or _T("SMTP") so please tell me about all possible values those are used here.
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
This is a suggestion, if you couldn't get a good answer by the end of the day, can you have a look at this codeproject[^] article ?
Also look at the comments and postings for the article, it gives some more links to dig with.
|
|
|
|
|
hi,
I have used MFC feature pack for MDI application.
I want to add docking pane to mdi child window.
i have used same MDI mainframe docking pane source code for the child window.
it works partially. Because when i open first new child window, the docking pane (from child window) has initial width is equal to 1 only.
but when i open second child window, this time the size of docking pane (from second child window) appears as per required size.
I m not able find out, what 's wrong with first child window docking pane.
|
|
|
|
|
I've got this piece of code:
#include <iostream>
#include <string>
#include <map>
#include <vector>
using namespace std;
int main()
{
{
int ia11[30] = {3,9,17,21,24,31,33,36,42,49,
4,8,19,22,28,30,34,39,43,47,
2,6,10,13,14,25,29,37,38,46};
int ia34[30] ={1,6,12,15,22,27,31,32,41,42
,4,7,14,17,23,30,33,36,45,48
,2,9,13,18,21,26,34,39,44,49};
int ia72[30] = {3,8,11,18,22,25,36,37,43,46
,1,6,16,17,23,28,35,40,41,44
,2,5,12,19,24,27,31,34,42,49};
int ia167[30] ={3,4,12,15,21,28,32,39,47,48
,6,9,16,17,29,30,31,38,41,42
,7,8,11,20,26,27,34,35,45,46};
int ia190[30] = {3,10,11,14,22,23,32,35,43,44
,6,9,16,19,24,29,37,38,45,48
,2,5,13,18,25,30,31,40,41,0};
int ia21[30] ={ 2,5,16,19,25,30,34,39,45,48,
1,9,12,13,21,24,33,36,44,49,
3,8,15,20,23,26,35,40,43,46};
int ia64[30] ={6,9,13,20,28,29,33,40,43,48
,2,7,16,19,24,27,31,34,44,47
,5,8,14,17,21,30,32,37,41,46};
int ia102[30] ={4,9,14,19,22,29,35,38,46,47
,5,8,13,16,21,26,33,40,41,48
,6,7,15,17,28,30,32,39,42,45};
int ia178[30] ={6,9,15,20,23,24,37,38,42,45
,7,8,16,19,22,25,34,39,43,46
,1,2,17,18,26,29,31,40,47,0};
int ia180[30] ={1,4,13,18,27,30,33,38,45,46
,2,3,12,15,22,23,39,40,44,47
,8,9,11,17,24,25,32,37,49,0};
vector<int>via11(ia11,ia11+30);
vector<int>via34(ia34,ia34+30);
vector<int>via72(ia72,ia72+30);
vector<int>via167(ia167,ia167+30);
vector<int>via190(ia190,ia190+30);
vector<int>via21(ia21,ia21+30);
vector<int>via64(ia64,ia64+30);
vector<int>via102(ia102,ia102+30);
vector<int>via178(ia178,ia178+30);
vector<int>via180(ia180,ia180+30);
typedef map<string,vector<int>>container;
container::iterator it;
container map;
map.insert(make_pair("ia11", via11));
map.insert(make_pair("ia34", via34));
map.insert(make_pair("ia72", via72));
map.insert(make_pair("ia167", via167));
map.insert(make_pair("ia190", via190));
map.insert(make_pair("ia21", via21));
map.insert(make_pair("ia64", via64));
map.insert(make_pair("ia102", via102));
map.insert(make_pair("ia178", via178));
map.insert(make_pair("ia180", via180));
for (it=map.begin();it!(=map.end();++it))
cout<<it->second<<; //the compiler stops here!
cout<<endl;
}
system("PAUSE");
return (0);
}
At the very end there is an error. I,d like the iterator /it/ to find vectors of integers intelligently and display them in the order the strings in the map container appear. I don't know how to do it. Could anybody possibly help me?
|
|
|
|
|
Waldemar Ork wrote: cout<<it->second<<; //the compiler stops here!
And?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
Waldemar Ork wrote: cout<<it->second<<; //the compiler stops here!
Change that to
std::copy(it->second.begin(), it->second.end(), std::ostream_iterator<int>(std::cout, ", "));
std::cout << std::endl;
(He said, without compiling or testing - give me a couple of minutes...)
[edit]Couple of minutes later - Works after fixing a couple of typos. Also, you need to #include algorithm and iterator.[/edit]
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
OHHHHHH! Nice StLuart!
|
|
|
|
|
Thanks a lot, I'll try it tomorrow. You were very helpful!
|
|
|
|
|
hi,
im a newbie to MFC can u suggest me any link to start with....im using vs 2003
|
|
|
|
|
kumar sanghvi wrote: can u suggest me any link to start with
www.google.com
|
|
|
|
|
|
Make a project for yourself and try to find similar article in the codeproject.com and post your questions here.
|
|
|
|
|
|
Hi
I need to relocate chunk of memory like following:
From:
0-----loc1----------------loc2---------------loc3----------loc4
+------+--------------------+------------------+-------------+
|Header|--------1-----------|-------2----------|-----3-------|
+------+--------------------+------------------+-------------+
To
0-----loc1----------------loc2---------------loc3----------loc4
+------+--------------------+------------------+-------------+
|Header|--------3-----------|-------2----------|-----1-------|
+------+--------------------+------------------+-------------+
Best regards,
|
|
|
|
|
If you need to move a block of memory, memmove[^]
However the rest of what you posted does not seem like you want to do that.
|
|
|
|
|
transoft wrote: Is there a easy way to move chunk of memory?
What is the difficult one?
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]
|
|
|
|
|
there's no simple function to do that, no.
you'll probably have to copy the three chunks to temp buffers, then write them back to the original buffer in the new order.
|
|
|
|
|
I have a program running on several PCs at the same time (VS6.0, C++, MFC). The customers data files are stored centrally on the network. He's complaining that the same data file can be open on different computers at the same time and changes made to one are being overwritten by the other.
Is it my problem to check if two PCs are accessing the same file or is it an IT function?
If it is my problem is there anyway to detect programatically whether a file is already open somewhere else?
Thanks
|
|
|
|
|
Caslen wrote: If it is my problem is there anyway to detect programatically whether a file is already open somewhere else?
Open it exclusively. All other attempts will fail.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
CFile::shareExclusive <-- Just what I need, thanks for the pointer.
I think shareDenyWrite would be better though allowing subsequent users read only access is that correct? Does it display a message indicating read only?
|
|
|
|
|
Caslen wrote: Does it display a message indicating read only?
What is 'it'?
Anyway - don't do that, because you still have the problem of other users reading the file while you're writing to it (because file writes aren't atomic operations) and potentially getting an inconsistent view of the file. That's why you get 'single writer, multiple reader' locks for use with in-memory resources - the resource is locked exclusive while the writer's active, but otherwise, multiple people can read the resource concurrently.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Stuart Dootson wrote: What is 'it'?
If a user tries to open an already open file is a message displayed but obviously that is up to the programmer to display the message. I've been rooting through the code (not mine) and it uses IStorage objects opened with the STGM_SHARE_EXCLUSIVE flag set. Is there any condition where this might not prevent a second copy from being opened?
|
|
|
|
|
Sorry, don't know - IStorage isn't something I've used
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Caslen wrote: I've been rooting through the code (not mine) and it uses IStorage objects opened with the STGM_SHARE_EXCLUSIVE flag set. Is there any condition where this might not prevent a second copy from being opened?
Yes. It prevents others from subsequently opening the object in any mode.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
I'm unsure of how the file is prevented from opening and particularly in my case where it clearly is allowed to be opened in some (but not all) cases.
On site there are several versions of software in use - it is possible that an older version does not use the STGM_SHARE_EXCLUSIVE flag. If this older version first opened the data file would the new version with the flag still be able to open it?
What about the opposite situation where the new verion opens the data file first - would the older version be 'aware' that the file is already open if it doesn't recognise the STGM_SHARE_EXCLUSIVE flag?
Thanks for your help on this.
|
|
|
|
|