|
SYMPTOMS
When making a call to TabPage.setSelectedTab() from within an OnSelectedIndexChanged event handler of the parent TabControl, the focus will first go to the user-selected index before returning to the index value set in the setSelectedTab() call. In addition, when returning to the index set in code by the setSelectedTab() call, the children components of the set TabPage will not be visible and Control.setVisible(true) must be used, causing a noticeable flicker.
RESOLUTION
To work around this problem, call Control.setVisible(true) on the TabPage after the setSelectedTab() call is made.
Maybe on the resize event you need to again setVisible(true) to get the flicker to go away? Give it a whirl and see what happens...
Practice sesquipedalianism!
|
|
|
|
|
I have error in my clients's computer when view report. The error is "Cannot find keycodev2.dll or invalid keycode" I already follow this article http://support.crystaldecisions.com/library/kbase/articles/c2011205.asp. But i still have this error. Please help mee Thanks
|
|
|
|
|
Hi all
Is it possible to run MC++ apps from (for example) a C# .NET web application ? I'll be checking with the host but was wondering if anyone else had done this or similiar.
BTW the app in question 'brands' .EXE files for registered customers and I'd prefer not to port the existing code to C# etc.
TIA
Jerry
|
|
|
|
|
Why do u wanna run it as an app? Just load it as an assembly reference!
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
Go on. Gimme a bit more detail )
|
|
|
|
|
One of the major benefits of Microsoft® .NET is that it provides a language-independent development system. You can write classes in Visual Basic®, C++, C#—whatever—and use them in other languages; you can even derive from classes in a different language. But what happens when you want to call some old-school unmanaged DLL? You have to somehow translate .NET objects into the structs, char*'s, and function pointers C expects. In techno lingo, your parameters must be marshaled. Marshaling is a big topic, but luckily you don't have to know much to get the job done.
To call a DLL function from C#, first you must provide a declaration, something programmers using Visual Basic have been doing for years. In C#, it's DllImport:
using System.Runtime.InteropServices; // DllImport
public class Win32 {
[DllImport("User32.Dll")]
public static extern void SetWindowText(int h, String s);
}
In C#, you use DllImport to tell the compiler where the entry point lives and bundle your wrapper functions inside a class. You can give this class any name you like; I chose Win32. You can even put the class inside a namespace. To compile Win32API.cs, type:
csc /t:library /out:Win32API.dll Win32API.cs
Now you have a Win32API.dll you can use in any C# project.
using Win32API;
int hwnd = // get it...
String s = "I'm so cute."
Win32.SetWindowText(hwnd, s);
Practice sesquipedalianism!
|
|
|
|
|
Indeed and Thanks. My question was obviously not well phrased. Given that I have a working VC++ console app I could compile it for IL instead of native code. Would this package then run on a remotely hosted .NET server along with my Web Service ? Would this be true for an unmanaged (but still compiled to IL) DLL ?
I am all too familiar with marshalling etc ) And I must confess that I took the plunge and wrote an analogue in C# on the grounds that it would have to be done one day !
Jerry
|
|
|
|
|
Just because something is written "in .NET" doesn't make it remotable. It has to extend MarshalByObjectRef or be a value type and be serializable (in most cases, attributed with SerializableAttribute ). Something has to host the remote object, too. For instance, just having a console app won't work. Now, a console app that registers a well-known object (WKO) either via code or a config file (latter is preferable for easy changes) and keeps itself running (waits for a quit command of sorts) would work. Clients would connect to that WKO.
The documentation about .NET remoting is okay, at least if you already have some idea of what it does. If you don't, I suggest you get the book from MSPress entitled .NET Remoting (at www.microsoft.com/mspress/books/6172.asp).
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Sure but I was not asking about remoting. Can a .NET service invoke (using the Process class) a process written in unmanaged C++ but compiled to IL rather than native code ?
Jerry
|
|
|
|
|
The Process class can start any process executable, regardless of how it compiled (i.e., it doesn't matter if it is a VB executable, unmanaged C++, managed C++ or other from any other languages targeting the CLR, compiled PERL exectable, etc.).
Also, any C++ application compiled to IL is managed (save the purely native functions). You can't compiled to IL and have an unmanaged executable.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
The .NET Framework includes the base class library (BCL) and the common language runtime (CLR). The CLR just-in-time compiles (jit's) intermediate language (IL, or more specifically MSIL) and executes it. Languages that target the CLR (MC++, C#, VB.NET, J#, PERL.NET, etc.) compile to IL in the form of assemblies, which are executable files (.exe, .dll) that contain 0 or more modules (compiled code), 0 or more embedded resources, various assembly attributes, and a manifest (like a plane or boat passenger manifest) of all that stuff in the assembly. So, it doesn't matter which language you use they all compile to assemblies using IL.
Make yourself a Managed DLL project for MC++ and puts some classes into it. Make a Windows Forms application (or something) in C#. If both of these projects are in VS.NET in a single solution, right-click on the Windows Forms project and click Add Reference. Click the Project tab and select your other project. Otherwise, click the .NET tab and browse for the MC++ assembly. Use classes from the MC++ assembly and compile your app. Viola'!
This is - in essence - no different from library bindings in Win32 or any other programming platform. It's all in the docs!
Consider yourself educated - now go out and read the docs to further your education!
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Thanks Heath. PLease see my reply to the previous post.
Jerry
|
|
|
|
|
I create setup program for distributed my application to client. The client computer doesn't have .Net 2003 and crsytal report. I have problem with crystal decision when I view report from my application. The computer must be install .Net 2003. But I don't want to install it. I already install .Net Framework 1.1, but it is still erorr. How to resolve that. I really thank you, if you guys can help me
|
|
|
|
|
Contact Crystal for a redistributable product license key.
I'd offer more information than that, but I wasn't the one that had to deal with Crystal Reports the last time we completed a project using it. It looks like you need to add the redistributable to your deployment project and add a custom property with the license key details.
|
|
|
|
|
somebodys can help me do that?
why i'm try delete it but occur an error "access denied" so that folder i had shared with full control for everyone
thanks!!!
Nho'c Ti`
|
|
|
|
|
Start by eliminating the possibilty that it is user related. Take a copy of the file and see if you can delete manually but using the same user that will the code runs as. If this works and the application still cannot delete another copy of the file, then it has to be code.
We would then need to see some source to find out why it doesn't work.
Al.
|
|
|
|
|
|
I'm having difficulty getting the Microsoft Application Block for Exception Management working. In particular, I'm trying to customize the DefaultPublisher so that it uses a custom log source in the EventLog.
Here are some of my constraints, many of which I've overcome.
1) I wanted the assembly deployed to the GAC so that more than one app could share it.
2) My apps are web apps, so I had to deal with security issues regarding getting a custom log source set up.
OK, so I created my strong names for the ExceptionManagement and Interfaces assemblies, and got both installed to the GAC. No problem. I used the INSTALLUTIL.EXE to run the custom installer for the ExceptionManagement assembly.
So far so good. I manually created the registry key and string value for my log source.
Next, I set up the web.config file. Here's the way I had it set up the first time:
<configSections>
<section name="exceptionManagement" type="Microsoft.ApplicationBlocks.ExceptionManagement.ExceptionManagerSectionHandler, Microsoft.ApplicationBlocks.ExceptionManagement" />
</configSections>
<exceptionManagement>
<publisher assembly="Microsoft.ApplicationBlocks.ExceptionManagement" type="Microsoft.ApplicationBlocks.ExceptionManagement.DefaultPublisher"
logName="Application" applicationName="My App Log Source" />
</exceptionManagement>
Now when I generated an exception, several were logged using my custom log source, including several that it was unable to find the type for the section handler. Well, I figured out that it was because I had an assembly in the GAC and hadn't fully qualified the names.
So I fixed the web.config to be:
<configSections>
<section name="exceptionManagement" type="Microsoft.ApplicationBlocks.ExceptionManagement.ExceptionManagerSectionHandler,Microsoft.ApplicationBlocks.ExceptionManagement, System, Version=1.0.1404.32518, PublicKeyToken=d16c1e31f52ae760, Culture=neutral" />
</configSections>
<exceptionManagement>
<publisher assembly="Microsoft.ApplicationBlocks.ExceptionManagement"
type="Microsoft.ApplicationBlocks.ExceptionManagement.DefaultPublisher, System,
Version=1.0.1404.32518, PublicKeyToken=d16c1e31f52ae760, Culture=neutral" logName="Application" applicationName="My App Log Source" />
</exceptionManagement>
Well, now to the point I'm at now. I get an internal exception that has the following detail. I'm at wits end! Any help would greatly be appreciated!!!
Thanks,
Andy
1) Exception Information
*********************************************
Exception Type: System.Configuration.ConfigurationException
Message: Exception creating section handler. (E:\Users\All Users\Documents\Dev\dotNet\AcssExtranet\Web\web.config line 5)
BareMessage: Exception creating section handler.
Filename: E:\Users\All Users\Documents\Dev\dotNet\AcssExtranet\Web\web.config
Line: 5
TargetSite: System.Configuration.IConfigurationSectionHandler GetFactory(System.String)
HelpLink: NULL
Source: System.Web
StackTrace Information
*********************************************
at System.Web.Configuration.HttpConfigurationRecord.GetFactory(String configKey)
at System.Web.Configuration.HttpConfigurationRecord.Evaluate(String configKey, SectionRecord section)
at System.Web.Configuration.HttpConfigurationRecord.GetConfig(String configKey, Boolean cacheResult)
at System.Web.Configuration.HttpConfigurationRecord.GetConfig(String configKey, Boolean cacheResult)
at System.Web.HttpContext.GetConfig(String name)
at System.Web.Configuration.HttpConfigurationSystemBase.System.Configuration.IConfigurationSystem.GetConfig(String configKey)
at System.Configuration.ConfigurationSettings.GetConfig(String sectionName)
at Microsoft.ApplicationBlocks.ExceptionManagement.ExceptionManager.Publish(Exception exception, NameValueCollection additionalInfo)
2) Exception Information
*********************************************
Exception Type: System.IO.FileNotFoundException
Message: File or assembly name Microsoft.ApplicationBlocks.ExceptionManagement, or one of its dependencies, was not found.
FileName: Microsoft.ApplicationBlocks.ExceptionManagement
FusionLog: === Pre-bind state information ===
LOG: DisplayName = Microsoft.ApplicationBlocks.ExceptionManagement, Culture=neutral, PublicKeyToken=d16c1e31f52ae760
(Partial)
LOG: Appbase = file:///E:/Users/All Users/Documents/Dev/dotNet/AcssExtranet/Web
LOG: Initial PrivatePath = bin
Calling assembly : (Unknown).
===
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Post-policy reference: Microsoft.ApplicationBlocks.ExceptionManagement, Culture=neutral, PublicKeyToken=d16c1e31f52ae760
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/extranet/742de6b4/69ece159/Microsoft.ApplicationBlocks.ExceptionManagement.DLL.
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/extranet/742de6b4/69ece159/Microsoft.ApplicationBlocks.ExceptionManagement/Microsoft.ApplicationBlocks.ExceptionManagement.DLL.
LOG: Attempting download of new URL file:///E:/Users/All Users/Documents/Dev/dotNet/AcssExtranet/Web/bin/Microsoft.ApplicationBlocks.ExceptionManagement.DLL.
LOG: Attempting download of new URL file:///E:/Users/All Users/Documents/Dev/dotNet/AcssExtranet/Web/bin/Microsoft.ApplicationBlocks.ExceptionManagement/Microsoft.ApplicationBlocks.ExceptionManagement.DLL.
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/extranet/742de6b4/69ece159/Microsoft.ApplicationBlocks.ExceptionManagement.EXE.
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/extranet/742de6b4/69ece159/Microsoft.ApplicationBlocks.ExceptionManagement/Microsoft.ApplicationBlocks.ExceptionManagement.EXE.
LOG: Attempting download of new URL file:///E:/Users/All Users/Documents/Dev/dotNet/AcssExtranet/Web/bin/Microsoft.ApplicationBlocks.ExceptionManagement.EXE.
LOG: Attempting download of new URL file:///E:/Users/All Users/Documents/Dev/dotNet/AcssExtranet/Web/bin/Microsoft.ApplicationBlocks.ExceptionManagement/Microsoft.ApplicationBlocks.ExceptionManagement.EXE.
TargetSite: System.Type GetType(System.String, Boolean)
HelpLink: NULL
Source: mscorlib
StackTrace Information
*********************************************
at System.Type.GetType(String typeName, Boolean throwOnError)
at System.Web.Configuration.HttpConfigurationRecord.GetFactory(String configKey)
For more information, see Help and Support Center at
Andy Hochstetler
|
|
|
|
|
I'm using the callback function of RASDIAL (RASAPI32.DLL). It works just perfect: The RASDIAL call returns immediately and my callback function is called numerous times to process the progress/error messages. In order to wait for the successful connection, I wrote a WHILE-loop in my main class to wait for the "Connected" message. That's where I'm having problems: the Application.DoEvents() in my WHILE-loop causes a System.NullReferenceException followed by message telling me that there is no source code available at the current position. I learned that the DoEvents call is for single-threaded programming and I guess that the RasDial callback function probably introduces multiple threads. I found a workaround by using a Timer without DoEvents() but then I find myself left in the Timer-Event to go on with my app. Summary: I WANT TO USE DoEVENTS() or something equivalent! Can someone please help me out?
private void btnRasConnect_Click(object sender, System.EventArgs e) {
ras = new Dialup.RASDisplay();
uint retCode = ras.Connect(""); // RasDial with callback
if(retCode != 0) {
ras.DisplayRasError(retCode);
} else {
string tmpString = ras.GetLastMessage();
while((!tmpString.StartsWith("ERROR:")) &&
(tmpString != "Connected") &&
(tmpString != "Disconnected")) {
Application.DoEvents(); // **** causes abort in unknow module
tmpString = ras.GetLastMessage();
}
}
return;
}
public uint Connect(string varPhoneNr)
{
RASDIALPARAMS lprasdialparamsa = new RASDIALPARAMS();
FPtr myFunc = new FPtr(RasDialFunc);
lprasdialparamsa.szEntryName = m_ConnectionNames[0];
lprasdialparamsa.szPhoneNumber = varPhoneNr;
lprasdialparamsa.szDomain = "";
lprasdialparamsa.szUserName = "Administrator";
lprasdialparamsa.szPassword = "abcdefg";
uint retVal = RAS.RasDial(0,@"rasphone.pbk", ref lprasdialparamsa,0,myFunc, ref m_ConnectedRasHandle);
return(retVal);
}
public void RasDialFunc( uint unMsg, RASCONNSTATE rasconnstate, uint dwError ) {
string lpszMsg;
byte [] tmpBuf = new byte[256];
ASCIIEncoding encoding = new ASCIIEncoding();
string szStrBuf = encoding.GetString(tmpBuf);
if(dwError != 0) {
if ( RAS.RasGetErrorString( dwError, szStrBuf, 256 ) != 0 ) {
m_LastMessage = "ERROR: Undefined RAS Dial Error " + dwError.ToString();
}
else {
m_LastMessage = "ERROR: " + szStrBuf;
}
Disconnect();
return;
}
switch ( rasconnstate ) {
case RASCONNSTATE.RASCS_OpenPort: lpszMsg = "Opening Port";break;
case RASCONNSTATE.RASCS_PortOpened: lpszMsg = "Port Opened";break;
case RASCONNSTATE.RASCS_ConnectDevice: lpszMsg = "Connecting Device";break;
case RASCONNSTATE.RASCS_DeviceConnected: lpszMsg = "Device Connected";break;
case RASCONNSTATE.RASCS_AllDevicesConnected: lpszMsg = "All Devices Connected";break;
case RASCONNSTATE.RASCS_Authenticate: lpszMsg = "Starting Authentication";break;
case RASCONNSTATE.RASCS_AuthNotify: lpszMsg = "Authentication Notify";break;
case RASCONNSTATE.RASCS_AuthRetry: lpszMsg = "Authentication Retry";break;
case RASCONNSTATE.RASCS_AuthCallback: lpszMsg ="Callback Requested";break;
case RASCONNSTATE.RASCS_AuthChangePassword: lpszMsg = "Change Password Requested"; break;
case RASCONNSTATE.RASCS_AuthProject: lpszMsg = "Projection Phase Started";break;
case RASCONNSTATE.RASCS_AuthLinkSpeed: lpszMsg = "Link Speed Calculation";break;
case RASCONNSTATE.RASCS_AuthAck: lpszMsg = "Authentication Acknowledged";break;
case RASCONNSTATE.RASCS_ReAuthenticate: lpszMsg = "Reauthenticatation Started";break;
case RASCONNSTATE.RASCS_Authenticated: lpszMsg = "Authenticated";break;
case RASCONNSTATE.RASCS_PrepareForCallback: lpszMsg = "Preparation For Callback";break;
case RASCONNSTATE.RASCS_WaitForModemReset: lpszMsg = "Waiting For Modem Reset";break;
case RASCONNSTATE.RASCS_WaitForCallback: lpszMsg = "Waiting For Callback";break;
case RASCONNSTATE.RASCS_Interactive: lpszMsg ="Interactive";break;
case RASCONNSTATE.RASCS_RetryAuthentication: lpszMsg = "Retry Authentication";break;
case RASCONNSTATE.RASCS_CallbackSetByCaller: lpszMsg = "Callback Set By Caller";break;
case RASCONNSTATE.RASCS_PasswordExpired: lpszMsg = "Password Expired";break;
case RASCONNSTATE.RASCS_Disconnected: lpszMsg = "Disconnected";break;
case RASCONNSTATE.RASCS_Connected:
lpszMsg = "Connected";
m_connected = true;
break;
default: lpszMsg = "Noch nicht aufgenommener Fehler"; break;
}
m_LastMessage = lpszMsg + Environment.NewLine;
}
|
|
|
|
|
Some time ago, I found and downloaded a file that would convert files created by the two version from one to the other. Unfortunately, I have now lost it. Can anyone point me to it?
Prof. Lloyd
|
|
|
|
|
VSConvert[^].
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
http://www.codeproject.com/macro/vsconvert.asp
Practice sesquipedalianism!
|
|
|
|
|
I'm starting an application with Managed C++ with windows Forms. I know how change the current Culture and since this action every resouces that open take the new Culture Value( System::Threading::CurrentThread::CurrentUICulture = new Globalization::CultureInfo (String * IdCulture) (...) )
OK that's right, but what happens with the Main Form that is Loaded since the start of execution?
Can I do a Reload or something like that, by anyway, or assing dinamically another ResX File to the MainForm for translate it without Close()?
Thanks gurus, I expect your answers
|
|
|
|
|
You can't change the locale of a form once it is loaded. You have to create a new instance of the form with the new locale.
If you are really slick you could copy the original form, but with the new locale, and use the transparency set to 0. Once everything is in place you can fade it in over the old form, then remove the old form - This would be so nice from a UI perspective - no flicker of changing forms and a really obvious but subtle change occurs.
--Colin Mackay--
"In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown)
|
|
|
|
|
OK, Colin. It works.
Thank you very much.;)
|
|
|
|
|