|
Are the assemby versions the same between the one in the GAC and the one not in the GAC?
When you strongly-name an assembly the loading semantics change from just matching the assembly name to including public key token, version, and culture (for resource-only assemblys).
If you are constantly updating the assembly you are trying to load, ensure that the AssemblyVersionAttribute doesn't use * as part of the version number, otherwise the number will change every time you do a build which will require you to recompile your exe and/or provide a publisher policy (see MSDN for more info) so that it loads the correct version on each build.
James
"I despise the city and much prefer being where a traffic jam means a line-up at McDonald's"
Me when telling a friend why I wouldn't want to live with him
|
|
|
|
|
You are correct. The versions do not match. I will try deleting the one in the GAC and reapply gacutil and see how it goes. I have one little concern though. If I am using a using statement such as
# using <reformaterclasslibrary.dll> // in the GAC
do I need to specify version numbers and keys in the using statement. If I have to specify version numbers, or more information (recall that I am doing this on Win XP). How or where do I indicate this?
Thanks for all of your help.
|
|
|
|
|
Well James I am happy to report that we did it and I could not have done it with out your help. There was a slight difference in the minor version number of the shared assembly in the GAC and the one that the GAC pointed to. I am not completely sure how I let that happen, but I did. Perhaps I did a rebuild that I forgot about. I don't know. Also, I put a copy of the same version of that assembly in the debug folder of the client application so I could compile with the same version as was pointed to by the GAC.
The steps I followed...
1) To compile, I put a copy of my shared assembly in the same folder as my project. In the debug folder where my exe goes.
2) I removed the faulty version of the reference in the GAC
3) I readded my shared assembly to the GAC with the gacutil.exe and made absolute certain that the version numbers were exactly the same in the GAC, as assembly that the GAC pointed to and that this was the exact same version number that the client application was compiled with.
I really appreciate your help.
|
|
|
|
|
I havent tried this myself , but I'll have a look in the morning.
<a TITLE="See my user info" href=http:
|
|
|
|
|
Would this be the correct syntax to set the size of a control:
this->Size = System::Drawing::Size (500, 25); If I try using new I get the following two errors: error C2716: 'operator new' allocates value types on the C++ heap; use '__nogc new System::Drawing::Size' and error C2664: 'System::Windows::Forms::Control::set_Size' : cannot convert parameter 1 from 'System::Drawing::Size *' to 'System::Drawing::Size'
adding __nogc fixes the first error but the second still exists.
Thanks
- monrobot13
|
|
|
|
|
If Size is a property, you should use get_Size()
|
|
|
|
|
I don't want to get the size though, I'm trying to set the size of the control. using set_Size and simply Size and the same thing
- monrobot13
|
|
|
|
|
Did this syntax not work? I just tried it in VS.NET 2003 on a button control and it works. I haven't attempted it on VS.NET 2002.
Here is the code that worked for me. All I did was make a new windows forms application and added a button.
<br />
private: System::Void button1_Click(System::Object * sender, System::EventArgs * e)<br />
{<br />
Button* btn = __try_cast<Button*>(sender);<br />
<br />
<br />
btn->Size = System::Drawing::Size(100,100);<br />
<br />
}<br />
Later,
Nathan
---------------------------
Hmmm... what's a signature?
|
|
|
|
|
It did work for me as well. I just wasn't sure because I hadn't actually tried running the program before I posted. It did complie though.
- monrobot13
|
|
|
|
|
I am drawing continously in the button start click and stopping
in the Stop button method. Inorder to handle the message processing
inserted Application::DoEvents Method in but_StartClick. After i included this statement drawing is not continuous when i debug, control is not coming
out from Application::Doevents methos. Any body knows about this problem.
Please give me some solutions for this problem.
void but_StartClick(Object* sender, EventArgs* e)
{
bContinuous = true;
while(bContinuous)
{
//drawing function
Application::DoEvents();
}
}
Thanks & regards,
Uma
|
|
|
|
|
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.
|
|
|
|