|
I tried with the below codes but still no luck...
csRange.Format("C%d", nRow );
objWorksheet.Range( COleVariant(csRange), vtOptional);
and
objRange.Insert(COleVariant(-4121L), vtOptional);
Following Error Message while i tried with the above code "Memeber Not Found"..
Any other option?
Just need to insert a new row i am using Excel 2007 and excel9.h header file.
Thanks.
|
|
|
|
|
spalanivel wrote: Following Error Message while i tried with the above code "Memeber Not Found"..
What member is the compiler referring to?
"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
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
HI,
In my application im having one Dialogbar contains Listbox and editbox and i attached this DialogBar to Mainframe.
But i want to display this DialogBar only when some childviews are active.Otherwise this DialgoBar should be in hiding.TO get this in OnTImer() of Mainframe class.I did this..
void CMainFrame::OnTimer(UINT_PTR nIDEvent)
{
CMDIFrameWnd *pMainWnd = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd ;
CMDIChildWnd *fChWnd = (CMDIChildWnd*)pMainWnd->GetActiveFrame();
CView *pView = (CView*)fChWnd->GetActiveView ();
if(NULL != pView)
{
if(pView->IsKindOf(RUNTIME_CLASS(CGraphView)))
m_RecentAlarms.ShowWindow(SW_SHOW);
else
m_RecentAlarms.ShowWindow(SW_HIDE);
}
m_RecentAlarms.Invalidate();
CMDIFrameWnd::OnTimer(nIDEvent);
}
m_RecentAlarms is DialogBar.
It works for one time only.First when i go to CTuningView(I dont want dialogbar),the dialogbar gets hided.When i go to CGraphView,it shows.
But when again go to tuning view its not get hided.When i debug,the cursor goes to OnTimer() and it goes to SW_HIDE also..but even its showing here.
Pls help me in this issue.
Anu
modified on Friday, August 12, 2011 5:28 AM
|
|
|
|
|
Try Using ShowcontrolBar to show\hide the controlbar.
http://www.mono-project.com/Main_Page
|
|
|
|
|
|
Hi!
What's meant by Thread safe in VC++? How to make a Singleton class or object Thread safe?
|
|
|
|
|
this[^]
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
Use EnterCriticalSection and LeaveCriticalSection appropriately.
|
|
|
|
|
Bernhard Hiller wrote: Use EnterCriticalSection and LeaveCriticalSection appropriately.
Hi!
To create a singleton class we've to make the constructor as private and we should return the instance of the class using a static function. Where to use the above? Inside the constructor or inside the function which returns the instance of the class? Can you please elaborate on this or post some code?
|
|
|
|
|
you should use that around any code which should not be used by two threads at once. this includes any code that modifies the internal state of the singleton.
for example, if you have a list of items in your singleton that callers can modify via function calls, you should put a critical section guard around code which can modify the list, to ensure that two threads don't try to modify the list at the same time (which could mess up the internal state of the list).
void CMySingleton::AddToList(int newData)
{
EnterCriticalSection(...);
list.push_back(newData);
LeaveCriticalSection(...);
}
|
|
|
|
|
Errors :-
syntax error : missing ';' before identifier 'IOCounters'
'IO_COUNTERS' : missing storage-class or type specifiers
'IOCounters' : missing storage-class or type specifiers
The Coding is:-
IO_COUNTERS IOCounters; // WARNING! If you get error that IO_COUNTERS is undeclared
// then undefine it's definition above.
// Latest SDK defines this structure in <WinNT.h>
|
|
|
|
|
Try to include this
<WinNT.h> at the top(before any other headers.
|
|
|
|
|
I create an MDI application, with document type ".xyz". I can create, open and save this kind of document with new, open and save items from file menu. But I need to open a document file from the disk in follow way : I open mainframe window with no new document, and from a diferent items from menu, let's say, OnHelpTest open
"D:\Default.xyz" document file , how can I do that ?
I can't call
CMyDocument::OnOpenDocument(_T("D:\\Default.xyz"));
because if I try to get a pointer to CMyDocument with known way,
MDIGetActive()->GetActiveView()->GetDocument(),
failed, because is not document open already as I said ...
|
|
|
|
|
Can you call CWinApp::OpenDocumentFile(_T("D:\\Default.xyz")) ?
"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
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
That's exactly what I need it ! Thank you !
|
|
|
|
|
hi
porting a project from VC++ 6 to VS 2010 caused i find a mistake. in the following code i had written:
#include "StdAfx.h"
class A
{
public:
struct Info
{
int A::*a;
};
int a, b;
static Info m_values[];
};
A::Info A::m_values[] = {&a, &b};
...
indeed this is a simplified of what i had. VC 6 doesn't cause error!
1. how it fill m_values? i found that they're filled with 0 and 4!
2. is it essentially a bug of VC against VS 2010? how does it interpret this code? how can it assign m_values with non-instantiated member variables?! does it have a different interpretation when it sees this? i didn't try earlier versions of VS.
3. what's the difference between int A::* and int *?! i know that they're different when we're talking about global functions and member functions. but what about when we're talking about int's?
thx
|
|
|
|
|
people who write code like this should be put on burger-flipping stations...
Me think it worked on VC6 because the compiler was crap and did not comply to standards.
anyway check if that works (it compiles no VS2008 and VS2010):
A::Info A::m_values[] = {&A::a, &A::b};
Watched code never compiles.
|
|
|
|
|
thanx 4 ur reply, but what's the difference between these two?
a and b are not static data members to be pointed to. there must exist an instance.
if u mean the offset of them from the beginning of the class instance, we should use offsetof() in such a case which is completely different from this.
|
|
|
|
|
To be frank, I don't know how to interpret it and what it is supposed to be or to do.
You got a class containing an array of its own member variable addresses ?
ilostmyid2 wrote: if u mean the offset of them from the beginning of the class instance, we should use offsetof() in such a case which is completely different from this.
I don't mean anything ...
Debugging that code will display something like:
-A::m_values 0x00e77000 struct A::Info * A::m_values {a=0x00000000 } A::Info [2]
- [0] {a=0x00000000 } A::Info
+ a 0x00000000 int *
- [1] {a=0x00000004 } A::Info
+ a 0x00000004 int *
Where m_values[0] is the offset of the first variable and m_values[1] is the offset of the second variable...
It is quite an ugly piece of code.
Please explain what it is supposed to do .
Watched code never compiles.
|
|
|
|
|
I agree with you, don't see the point in having that array for a number of reasons... its static, so it'll only contain two values regardless of the number of instances of A, and those variables are public anyway, so what's the point of accessing them via a static array?
|
|
|
|
|
indeed it's not a code of mine or my friend. this a piece of a large project which my friend uses. they have to port the whole project containing the code from vc6 to vs2010. so, i'm not the writer and i don't know what has been the aim. eg. int is my replacement to CButton for simplification. the structure is not changed though.
|
|
|
|
|
Well, now the code compiles.
Just run it and see if the behaviour changes from VC6 to VS2010 ...
If it does not work as intended, then either try to understand what it is supposed to do or re-write it.
Watched code never compiles.
|
|
|
|
|
the code compiles only in vc6. in vs2010 i get an error indicating that the array cannot be initialized with &a and &b because they must belong to an instance of A and this is reasonable.
i need to know whether it's a bug of vc6 compiler or the vc6 compiler interprets it and makes in sense in a way that vs2010 doesn't.
|
|
|
|
|
My first answer fixed the compilation error.
In my opinion, this code is crap and should be rewritten/replaced with good meaningful code.
Check to see in real life ( in your actual code) if that still works (run) and it is doing what it is supposed to do.
Since I really don't know what this code is supposed to do (do you even know what it is supposed to to ?); I cannot help you more.
Good luck with that.
Max.
Watched code never compiles.
|
|
|
|
|
as i mentioned b4, i myself don't know what the code is supposed to do too. i just see that vc6 can realize it and guess the writer has written the code in the way it understand. i just need to know what does the code do so that i may port it to vs2010 to do the same behavior. that's all.
|
|
|
|