Answer Questions
TruePsion Compiler Error C3213 in C++/CLI
Compiler error C3213 says: "A type that will be visible from an assembly must use publicly visible base classes." Can anyone explain to me why this is so If another assembly accesses my publicly visible derived class, why must my entire base class hierarchy be publicly visible in .NET The issue for me is not so much that the base class can not be private but, because the base class just exists to be derived from, I only want the derived class to show up in the IDE's Toolbox as a component when tha assembly is added to the Toolbox. Normally if the base class were private, then naturally it would not be included in the Toolbox as a component. However now that I must make the base class publ ...Show All
M1tt Need info regarding how to print unicode characters using VC++
Hi, I need info regarding how to print unicode characters using VC++ Regards, Nishant For those that are concerned, this question is also in the VC General forum at Need info regarding how to print unicode characters using VC++ . ...Show All
Constantine- How to convert unsigned short[50] to CString?
How to convert unsigned short[50] to CString, the following is a example for this: TCHAR Key[50]; CString strParam1; strParam1 = Key; for the above statement, how to realize the data conversion in vc2005 Thanks you very much. Christian is right! But I wonder why you get problems with the shown code. If either UNICODE or not UNICODE is defined the assignment of a TCHAR array to a CString always work. What is the error of the compiler you get CString and TCHAR will work as per your current build environment. I dont think a CString can't load a unicode string in UNICODE build environment What version of MFC is this ( i.e. what compiler ). I thought later ones did this for you, CString is Unicode awar ...Show All
cutie GetFileSecurity(): Data area...too small
Hi, I am trying to read out the DACL for files and directories, to evaluate the contents. The problem is that I just can't get this function to work properly. In the examples that I have found I should be able to call GetFileSecurity twice in order to get the SecurityDescriptor for an Object. Everytime I get "The data area sent to the api function is too small" - reguardless of how I allocate (HeapAlloc() or malloc()), hardcoded parameters... it seems like a dead end. The soloution should be C based (no / minimal .NET). Please help me out. [code] void display_acl_info(char * file){ /*GetFileSecurity Vars*/ LPCTSTR lpFileName=NULL; BYTE * buffer=NULL; SIZE_T sizeSD=0; PSECURITY_DESCRIPTOR pSecurityDescriptor = NULL; /**/ ...Show All
pavc LNK2001: using unmanangedC++ in manC++
Hi, i'm writing a new user-interface for a small software-company. The old interface should be replaced by the new one, the "inner core" should stay. The old program was written in unmanaged C++, but now I'm writing the user-interface in C#, so I have to use class wrappers. While building the managed C++-project (in a solution with the unman. C++-projects) there a some errors. For example: Error error LNK2001: unresolved external symbol ___argv nafxcwd.lib and Error error LNK2001: unresolved external symbol ___argc nafxcwd.lib Another one: Error error LNK2001: unresolved external symbol __pgmptr db.lib [db is one of the old unmanaged C++-projects] The settings are the following: Linker->Input->Add. Dep ...Show All
Iram error LNK2019: unresolved external symbol ...
Hi, Help me please... While linking this : .h : int calculerPondTh( const STATIONS_METEO &stas_meto ) const ; .cpp : int ZONES::calculerPondTh( const STATIONS_METEO& sta_meteo) const { int surf,nbstm,nbstm1,resultat=-1; int *no_stations=NULL; int acalculer; float *dist_stations=NULL /*, facteur*/ ; register int i, j, k /*, nbStas*/ ; // Variable de boucles. float *pondTh, *temp; COORDONNEE *coord_point, *coor_sta; int nb_lin, nb_col; // Nombre de lignes et de colonnes composant // la matrice du bassin versant. int v_zone,v_zone1; long sta_donnees_lues /*, donnees_meteo_lues*/ ; FILE *fichierPondTh=NULL; SYChaine nomFichPondTh; char *pond; ...Show All
IRB Technician concept of encapsulation
give up with this one, I guess I don’t understand this concept of encapsulation, well I do but I don’t know how to make this program work I declare in the fraction_class the following: as a PRIVATE private : int pnum,pdem; //private numerator and private denominator use for asignment#5 int pnumb1; double presult; //double to hold the fraction decimal value static char const slash = '/' ; //static character field that hold the slash //Private function to calculate the decimal equivalent of a fraction //fraction Assig#5 void calculateDecimalValue() {presult = (( double ) num1 / ( double )dem1);} I understand that I need t ...Show All
hellomcv Saving a vector of Objects
I am saving data that is stored in a vector of objects. Currently I am witting them to a text file. I would perfer to write them to a binary file. How would I go about doing that. Then could you please specify which technology you are using Native C++ .NET If it is an MFC application, and your objects are derived from CObject , and your vector is of CObArray or CTypedPtrArray< CObArray > type, then I think you can store objects in binary format using "serialization" technique. For instance: CObArray myObjects; CFile file(_T("C:\\MyFile.data"), CFile::modeWrite | CFile::modeCreate); CArchive archive(&file, CArchive::store); myObject ...Show All
Jagdish Kumar Custom TcpListener class problem.
Operating system: Windows XP Home Ed. w/SP2 Technology: C++/CLR | .NET 2.0 I have created my own TcpListener class that is inherited from the TcpListener class from the System::Net::Sockets namespace. this class is contained in an assembly (type of dll). Here is the code of my assembly: // tcp.h #pragma once using namespace System; using namespace System::IO; using namespace System::Text; using namespace System::Net; using namespace System::Net::Sockets; namespace Tcp { public ref class Host : TcpListener { public: property String ^Name; property IPAddress ^IP; property int Port; Host(void) : TcpListener(IP, Port) { } }; } Now in the same solution I have another assembly (of type executable, and is a console appl ...Show All
tyler2424 static *int c;
hi, i am having this declaration with me .. i am not able to understand what actually dis means.. static *int c; .. it compiles properly with a warning : warning C4518: 'int ' : storage-class or type specifier(s) unexpected here; ignored. what is this i am not understanding.. please help manish i have one more doubt int *int c; above line compiles and variable "c" behavex like a pointer to int type.. . actually i want to kno how compiler detects these types.. how it categorises variables... . help me manish no its not an error its a warning.. so i can use this variable.. but what operations this varible is ...Show All
ChandraDevaraj GetDC() call
Hi All, Recently I worked with a code which someone else has written. The code is something as follows BOOL MyDialog::OnInitDialog() { m_pDC = GetDC(); // m_pDC is the member of the dialog class ..... } void RenderBitmaps() { // Many drawing calls m_pDC->SelectObject(bitmap); m_pDC->StretchBlt(....); } In some other functions it is using m_pDC as the device context for draw. Normally at that time, we will call "GetDC()" and from the returning pointer will call the drawing functions. the person who written the code was trying to reduce the code hence make the code faster. So can you see some hidden issue in the above said approach i.e making the DC Pointer as member In the code execution, I dint find any is ...Show All
akeiii MSVCRT.dll: Daylight Saving Time BUG when TZ variable is set.
Does anyone knows status of it Senate change Daylight saving time from April to March and from October to November. Now code, working in multi timezone screwed if TZ variable used. MSVCRT.dll from 2004 on my XP has April and October date hard coded. Proposed by Microsoft Fix (Unset TZ) will not work since We set it from program for current instance when needed to calculate Time for the person other then user of current PC when person is in different time zone. We're in Medical software business and very often User of the system (tech) works in PC time but Patient/Doctors are in different time zones (Big independent Lab for example). Specimen will be processed and "Tech" time used but in reports and query time for resulting should ...Show All
msedi LNK2019 Problems
Hi. I have a problem with linking external DLLs. Usually, I got this working: exporting_class A importing_class B < exporting_class A // OK Here's the problem I encountered: exporting_importing_class A < exporting_class B importing_class C < exporting_class B // OK importing_class C < exporting_importing_class A // NOT OK All DLLs are compiled with Multi-threaded Debug DLL. When I checked the buildlog, it states that it's able to read exporting_class B and load its DLL, but it only searches for class A but there's nothing after that, then throws me an error. Where have I miss here Guys I solved my problem. Turns out that in exporting_importing_class A, I did Not Set the Character Set. After I changed it to Use Unicode Bu ...Show All
Kamen place for code
maybe this is a stupid question, but I have started microsoft visual C++ today (c++ itself also for the first time) and i dont know where to put the code. i'm making the program hello world, but it doesnt work it asks if i want to 'build' the programm and i dont know what it means. i named the program hello and i put the code in the place where it says: hello.cpp is this the right place if so, what am i doing wrong this is the code: // hello.cpp : Defines the entry point for the console application. // #include "stdafx.h" int _tmain( int argc, _TCHAR* argv[]) { return 0; } #include <iostream.h> int main() { cout << "Hello World!\n" ; return 0; } ...Show All
SidharthMalhotra LNK2019 for GetThisClass in 2003 to 2005 migration
I have looked all over and cannot find anything that seems related to this problem. I know it is related to MFC, but it it beyond me how to fix it. I have checked that _AFXDLL is defined, so the macros should be correct. This the MFC code that is compiled: m_pSessionDocTemplate = new CMultiDocTemplate(IDR_SESSIONTYPE, RUNTIME_CLASS(CSessionDoc), RUNTIME_CLASS(CMultiViewFrame), // custom MDI child frame RUNTIME_CLASS(CSessionView)); m_pSessionDocTemplate->SetServerInfo(IDR_SESSIONTYPE_SRVR_EMB, IDR_SESSIONTYPE_SRVR_IP, RUNTIME_CLASS(CSessionIPFrame)); These are the link errors: dyna32.obj : error LNK2019: unresolved external symbol "public: static struct CRuntimeClass * __stdcall CSessionIPFrame: ...Show All
