|
I presume you're talking about warning 4251.
"If your project declares a class class __declspec(dllexport), and that class has members of the std::* type, you see C4251 warnings. Because all your code is built with the std::* class now statically linked, you can ignore these warnings. To explicitly disable those warnings, use the following notation: #pragma warning(disable: 4251)"
This is what I do, and I've never had any problems with it.
Hope it'll help you as well.
|
|
|
|
|
I have an application that needs data from a Database, which will be very large ~ 200K bytes.
I was thinking to exporting this database to a Comma Spearated Format file and creating a library of this data.
e.g.
static int myData1 [64][8] = {0};<br />
static float myData2 [64][8] = {0};<br />
static bool myData3 [128][8] = {0};
The above data arrays would be popluated by a program reading this CSF file
giving:-
static int myData1 [32][32] =<br />
{ <br />
{{1,0},{0,0},{0,0},{0,1},{0,1},{0,0},{0,0},{0,0}, <br />
{0,0},{0,0},{1,0},{0,0},{0,0},{0,0},{0,1},{0,0}, <br />
{0,0},{0,0},{0,0},{0,0},{0,0},{1,0},{0,0},{0,0}, <br />
{0,0},{0,1},{0,0},{0,0},{0,0},{0,0},{0,1},{0,0}, <br />
...
...
etc
i.e. writing the declarations and filling in the initial values (writing the cpp code to a file).
The library would then be built and included in my program.
My question is how to access this data as the library will have no functions, just data.
What I am treying to do is create/fill and be able to use a data structure quick and simple in my program.
Any comments!
|
|
|
|
|
Can anybody help me in replacing a substring:
string s1 = "Here goes string - sample string";
string s2;
...
s1.replace...
...
...
s2 must be "Here goes solution - sample solution"
XPiS
|
|
|
|
|
s2 = s1.Replace("string", "solution");
Check the syntax at MSDN here [^]
...Plug & Pray...
|
|
|
|
|
HI,
I have a Barcode reader ,,that is attahced with COM port.
I wanaa make application that recv the data when i read from Barcode reader ,, n show it ..
any sample .. help
thanx
|
|
|
|
|
I'm looking for a method to get Per Thread CPU Usage in VC++.
I know you can get total with PerformanceCounter _Total - but
I want per thread CPU Usage.
Thanks alot .
|
|
|
|
|
See GetThreadTimes() API.
onwards and upwards...
|
|
|
|
|
Thank you very much .
Your guide is very good .
|
|
|
|
|
That's what the szInstanceName member of PDH_COUNTER_PATH_ELEMENTS is for. The threads (instances) are 0-based. See my response here. Change szObjectName to "Thread", assign szInstanceName a value, change szParentInstance to the name of the process that has the threads.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Thanks a'lot for your guide .
|
|
|
|
|
It appears to me that IE, if challenged by a web server for authorization will send my current username/password and try and authorise me with those before asking for another username/password.
Is there something I can get obtain from the system to authorise a user with without having to ask for and supply the username/password? It looks like C# has something along these lines in CredentialCache.DefaultCredentials, but I need pure Win32 methods.
|
|
|
|
|
i have created a VC++ application. The .exe depends on few dlls. one of them is MSJET35.dll. i converted the dll into MSJET35.lib. now, i want to statically link this library with my exe so that it runs independently on any machine irrespective of the presence of MSJET35.dll. but i do not know how to link statically with a library. need help, suggestions on this matter
|
|
|
|
|
You can't convert a DLL to a static lib without the source code. Most likely, you've succeeded in creating an import lib for the DLL. MSJET32.DLL sounds like a MS ODBC-DLL, there's no chance you'll ever be able to link it statically to your app
|
|
|
|
|
HI~
How to search a substring from LPWSTR?
Also I cannot extract a character like string class
e.g
I cannot do this:
LPWSTR a_string = _T("abcdef")
if (a_string[2] == 'c'){...}
How to extract a character is the string is LPWSTR type?
Thanks
|
|
|
|
|
LPWSTR a_string = _T("abcdef");
if (a_string[2] == (WCHAR)'c'){...}
...Plug & Pray...
|
|
|
|
|
Dimitris Vassiliades wrote:
(WCHAR)'c'
Actually the correct syntax is L'c' for wide-char literals. (Your code will work but I didn't want the original poster to get the idea that casts are the solution for string-related stuff.)
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
Actual sign at the laundromat I go to: "No tinting or dying."
|
|
|
|
|
LPCTSTR SubString( LPCTSTR lpExpression, // [in] Pointer to a string to extract the substring from
ULONG nStart, // [in] Starting point
LONG nLength = -1 ) // [in] how far to go from the startig point, use -1 to go the end of lpExpression
{
if( nLength < 0 )
nLength = strlen(lpExpression) - nStart;
ULONG nPos = 0;
PTCHAR lpResult = new TCHAR[512];
for( ULONG i = nStart; i < (ULONG)(nStart+nLength); i++ )
{
// put the current char from lpExpression into lpResult
lpResult[nPos++] = lpExpression[i];
}
// add the null byte to lpResult;
lpResult[nPos] = '\0';
// return the substring
return lpResult;
}
|
|
|
|
|
Hi,
i m recving data from bar code reader ,, on Socket
In which format a bar code reader send data ..
i m not properly formating it.
2 .... as to format integer
CString s;
int value
DWORD dval
s.Foramt( "%d" , value);
wt i will use for DWORD in place of "%d" in format
thanx
|
|
|
|
|
INT_PTR nResponse = dlg.DoModal();
return -1 if when i add a custom control using resource editor.
how can i solve this?
|
|
|
|
|
Probably the window class for custom control is not registered before DoModal call. Are you trying to call RegisterClass in OnInitDialog?
Tomasz Sowinski -- http://www.shooltz.com
Alika masiaka!
|
|
|
|
|
Hi all
I have a little problem. I am using ADO to connect to a database, I have managed to add records to this db, but when I want them displayed the recordset is empty, what am i doing wrong?
Is it possibly because access 2000 has limitations on the amount of fields you can view?, Is it because ADO has limitations on the record set?, I have even copied working code from another program and still the record set is blank!
Here is the code:
<br />
void CViewRptDlg::OnShowReport()<br />
{m_strConnection = _T("DSN=Report_prg");<br />
m_strCmdText = _T("Select * From R_tbl where MonthName='"+CString(m_strMonth)+"' and WardNumber='"+CString(m_strWard)+"'");<br />
m_pConnection = NULL;<br />
m_pCommand = NULL;<br />
m_pRs = NULL;<br />
m_piADORecordBinding = NULL;<br />
::CoInitialize(NULL);<br />
<br />
try<br />
{<br />
<br />
m_pConnection.CreateInstance(__uuidof(Connection));<br />
m_pCommand.CreateInstance(__uuidof(Command));<br />
m_pRs.CreateInstance(__uuidof(Recordset));<br />
m_pRs->Open(LPCTSTR(m_strCmdText),LPCTSTR(m_strConnection),adOpenDynamic,adLockOptimistic,adCmdUnknown);<br />
if(FAILED(m_pRs->QueryInterface(__uuidof(IADORecordBinding),(LPVOID*)&m_piADORecordBinding)))<br />
_com_issue_error(E_NOINTERFACE);<br />
m_piADORecordBinding->BindToRecordset(&m_rsRecSet);<br />
RefreshBoundData(); <br />
}<br />
catch(_com_error &e)<br />
{<br />
GenerateError(e.Error(),e.Description());<br />
}<br />
<br />
void CViewRptDlg::RefreshBoundData()<br />
{<br />
CCustomRs *pRs = GetRecSet();<br />
<br />
if(adFldOK == pRs->lReportIDStatus)<br />
m_nReportID = pRs->m_nReportID;<br />
else<br />
m_nReportID = 0;<br />
if(adFldOK == pRs->lMonthNameStatus)<br />
m_strMonth = pRs->m_szMonthName;<br />
else<br />
m_strMonth = _T("");<br />
if(adFldOK == pRs->lWardNumberStatus)<br />
m_strWard = pRs->m_szWardNumber;<br />
else<br />
m_strWard = _T("");<br />
UpdateData(0);<br />
}<br />
|
|
|
|
|
i want to limit the entry size in the edit-box. How do i do? secondly, I want to enter only numbers and special characters into my edit, no characters. how do i change it?
|
|
|
|
|
|
See the EM_LIMITTEXT message.
onwards and upwards...
|
|
|
|
|
Can anyone point me to an example of an MFC owner drawn window? (That does NOT use a remake of CDialog class)
|
|
|
|
|