|
Its working now
check knowledge base
PRJ: Toolbar Buttons Don't Work When Using DoEvents Statement article in MSDN.
PSS ID Number: Q147409
When the DoEvents statement runs in a Visual Basic for Applications macro, toolbar button commands will not run. The toolbar buttons appear fully functional, but clicking a toolbar button will not run the command for that button. Menu commands, other macros, and other applications can be run normally.
Actually i placed drawing code in ToolBar button. Now i moved to Button it is working fine.
|
|
|
|
|
I have a strange compiler error on my program. My compiler is Visual C++ .Net. The error is:
"error C2872: 'IServiceProvider' : ambiguous symbol"
on the file afxole.h of the MFC.
I don't understand what is the problem, because I don't use that class ...
Can you help me ?
Thank you very much for any answer.
Andrea
|
|
|
|
|
SD3 wrote:
"error C2872: 'IServiceProvider' : ambiguous symbol"
It means that IServiceProvider is defined in two different places. I believe in this example it is defined both in ServProv.h (which is probably included through afxole.h and its includes) and in the System::IServiceProvider interface.
You can fix this by putting your windows include files into a different namespace:
#using <mscorlib.dll><br />
namespace Win32<br />
{<br />
#include <windows.h><br />
}<br />
using namespace System;
Answer comes from this book:
Programming with Managed Extensions for Microsoft Visual C++ .NET--Version 2003[^]
Hope this helps,
Nathan
---------------------------
Hmmm... what's a signature?
|
|
|
|
|
Nathan Blomquist wrote:
Hope this helps
If it doesnt, it does help me
<a TITLE="See my user info" href=http:
|
|
|
|
|
Glad I could help...
That book I mentioned in my response is really good. Just the first chapter is worth the money I spent on it.
Makes me almost want to use MC++ instead of C# (almost)
Later,
Nathan
---------------------------
Hmmm... what's a signature?
|
|
|
|
|
Dear forum members,
Can anybody tell me how I can pass a reference of a CString object to a
C++ dll designed in Visual Studio 6.0 ? How do I access the string which
is in the CString object ?
I tried the following in my code. An exception was generated when I tried
to pass the same CString object 2nd time and accessed the contents of it !!!
sample code:
// in VC++ 6.0 dll: ...
void MyVC6Fn( CString& strComment )
{
strComment = "Hello";
}
// end
// in VC++ .Net dll ...
CString strComment;
CString strTemp;
MyVC6Fn( strComment );
strTemp = strComment; // -->> Exception here ! *********
// end
Can anyone help ? This is urgent ...
Thanks in advance.
|
|
|
|
|
I am not sure you can do that because CString is implemented very different in VC++7 than VC++6.
John
|
|
|
|
|
What's the Exception?
- monrobot13
|
|
|
|
|
The following text appears in the Exception dialog:
An unhandled exception of type 'System.NullReferenceException' occurred in MyDll.dll
Additional information: Object reference not set to an instance of an object.
|
|
|
|
|
Hi rkvs.
If VC6's CString and VC7's CString class are different, then you can't pass it as a class (reference). because they are quite different classes, just their names are same.
so you'd better pass it char* data type.
I guess both of CString classes has (LPCSTR) casting operator.
Have a good day~
- taeho -
|
|
|
|
|
Hi All,
I'm the first to admit that I'm not to good at the design aspect of programming. So first I was wondering if anyone had any good suggestions on books that I could read that would help out with this topic. All comments are appreciated.
Second, I have a design question. I'm currently writing a program that uses a tabcontrol and I'd like end user to be able to dynamically add/remove/insert tabs into the program, now the problem is I'm not sure of the best way to implement this. I did design one version that used a checked listbox (in an options form) to allow the user to add/remove/insert "items", when the user clicked ok I would check what "items" had a check and create the tabs for them. Where I ran into a problem was that even items without a check need to be kept in memory so that when the user opens the options again they are still there (and it they check them they should be created, and vice versa) the other problem is that each tab has to have some data associated with it. What I did in the first design was have an array that I threw back and forth between the two forms, but that proved to be a very poor design. I'm just wondering if anyone has any better design that I could try I would really love to hear it. Any ideas or simple things to try would be extremely appreciated.
Thanks All!
- monrobot13
|
|
|
|
|
I am using Borland 5.02 version
but i can't find the way to include BGI file
for using graphics.
Please tell me the way to include this.
Thanks.
|
|
|
|
|
You should probably ask this in the Visual C++ forum because Managed C++ is a .NET language in which C++ code is executed in a virtual machine. It will allow you to mix C++ code with VB.NET, C#.NET and other .NET languages and run in the same environment. At one time I actually knew the answer to your question but that was before I did windows programming...
John
|
|
|
|
|
|
Hi,
I'm trying to produce output like this: XXXXXXX
XXXXX
XXX
X
This is what I have so far and just wondering if I am on the right track.
#include <iostream>
#include <stdio>
using namespace std;
int main()
{
int i = 1;
int j;
cout << "How Big? ";
cin >> j;
//getchar();
for (j >= 1; j <= 7; j = j + 1)
{
for (j >= 1; j <= i; j = j + 2)
{
cout << "X";
}
cout << "\n";
}
}
I just wanted to know if I was on the right track. Thanks.
|
|
|
|
|
since you are using stl, I suggest using
basic_ios::fill
|
|
|
|
|
Is there an equivalent MC++ function to the C# one in the subject?
Thanks,
- monrobot13
|
|
|
|
|
String::Format()
<a TITLE="See my user info" href=http:
|
|
|
|
|
leppie wrote:
String::Format()
The problem with that is there isn't an overload that will take n number of parameters (at least not one I can find). So if I try to do this:
str = String::Format ("{0}{1}{2}{3}", str1, str2, str3, str4); I get an error that there is no overload of String::Format that takes five parameters.
Any idea how I can get around this?
Thanks in advance.
|
|
|
|
|
Just wrap it in a Object* __gc[]
<a TITLE="See my user info" href=http:
|
|
|
|
|
leppie wrote:
Just wrap it in a Object* __gc[]
I was hoping it wouldn't come to that, but I guess that's what I'll have to do.
Thanks!
-monrobot13
|
|
|
|
|
monrobot13 wrote:
I was hoping it wouldn't come to that,
Why?
<a TITLE="See my user info" href=http:
|
|
|
|
|
leppie wrote:
Why?
Because I'm not sure how to declare an array like that. I tried doing this, but it didn't work:
Object* strs[] = new Object* {S"Time ", msg.ToString ()}; If you could post how I should actually be declaring this array it would be appreciated. I was able to get it working with this code:
Object* strs[] = new Object* [2];
strs[0] = S"Time ";
strs[1] = msg.ToString (); But I prefer declaring it all in one line as it looks cleaner.
- monrobot13
|
|
|
|
|
Object* str __gc[] = new Object*[]{S"Time",msg};
That should work, try some combos
<a TITLE="See my user info" href=http:
|
|
|
|
|
Got it working. Thank you very much for the help!
- monrobot13
|
|
|
|