|
may be i did someting wrong but with what u have told i'm getting the error
1>main.obj : error LNK2001: unresolved external symbol "struct polygon pg" (?pg@@3Upolygon@@A)
1>main.obj : error LNK2001: unresolved external symbol "struct circles cl" (?cl@@3Ucircles@@A)
1>editor/Debug\editor.exe : fatal error LNK1120: 2 unresolved externals
please tell me how should i include my headers now... both in main.cpp and simulate.h ir is thr any other way
|
|
|
|
|
If you have an unresolved external error from the linker then you did not do what I said to exactly. Copy and paste the two definitions I showed in the previous post and put them where I said they need to go and it should work fine. I have used this technique for a long time with several different compilers and not had any problems.
|
|
|
|
|
In addition to what Rick has been telling you, maybe you should spend some time studying the difference between definition and declaration? Possibly something about storage classifiers and scope?
You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.
|
|
|
|
|
It is not a good idea to create global variables inside a header file.
So create a shapes.cpp file and put the global variables inside them.
In the shapes.h header file put the extern keyword before the global variable creation statement as mentioned in the other posts.
|
|
|
|
|
Hi,
I have read Jeffery Richter book On Duplicating Object Handles and am still confused how to get a real process handle
so...
If I am in a Childprocess trying to duplicate its handle for the Parent
I tried the following code in the Child Process
p.s. can some one point to where the documentation is for for using code tags for code snipets
I was sure it was on the menu bar from the Home page .....
<br />
<br />
snap_shot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);<br />
<br />
process32.dwSize = sizeof(PROCESSENTRY32);<br />
<br />
return_cde = Process32First(snap_shot,&process32);<br />
<br />
pid = GetCurrentProcessId();
<br />
while(pid != process32.th32ProcessID)<br />
{<br />
return_cde = Process32Next(snap_shot,&process32);<br />
}<br />
<br />
parent_process = process32.th32ParentProcessID;<br />
<br />
then DuplicateHandle(GetCurrentProcesId(),GetCurrentProcessId(),parent_process,&child_process_handle_in_context_of_parent,0,FALSE,DUPLICATE_SAME_ACCESS);
no Luck
In Parent process
<br />
<br />
return_code = CreateProcess(NULL,<br />
(LPCSTR) &child_buff[0],<br />
NULL,<br />
NULL,<br />
TRUE,<br />
NULL,<br />
NULL,<br />
NULL,<br />
&si,<br />
&pi);<br />
<br />
global_area_handle = pi.hProcess<br />
<br />
the DuplicateHandle(GetCurrentProcessId(),GetCurrentProcessId(),global_area_handle,&parent_in_context_of_child_handle,0,FALSE,DUPLICATE_SAME_ACCESS);<br />
<br />
no luck<br />
<br />
thankx
|
|
|
|
|
ForNow wrote: can some one point to where the documentation is for for using code tags for code snipets
Did you see the code block button at the top of the edit screen?
It's time for a new signature.
|
|
|
|
|
Is this a "feature" of VC 6.0 only?
The associated list box puts the scroll bar on the right and aligns the text on right also.
Now the user have to select the list box from left and select from the list box on right.
It is not a major problem, but...
Only constructive comments to the subject will be appreciated.
No lectures please.
Thanks for reading.
Vaclav
|
|
|
|
|
Vaclav_Sal wrote: Only constructive comments to the subject will be appreciated.
No lectures please.
What does the documentation say?
It's time for a new signature.
|
|
|
|
|
Right aligned text
Specifies that text is right-aligned within the dialog box. Type: Bool. Default: False.
|
|
|
|
|
Hi Forum
I have problem to write string in text file.I have a file which is create through admin account now i want to write string from lmited user account.I ahve use CStdioFile for create a file.Here is code
if( myFile.Open("C:\\Documents and Settings\\All Users\\Documents\\Adminfile.txt", CStdioFile::modeCreate | CStdioFile::modeWrite | CStdioFile::modeNoTruncate, &e ) )
{
myFile.SeekToEnd();
myFile.WriteString("AdminSting");
myFile.Close();
}
How can i write data in this file?
please help me.
|
|
|
|
|
Boost2010 wrote: I have problem...
...that you've not described. Without knowing what the code snippet is doing, how can we know what to suggest?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
thanks for reply
i am showing code there how i create file and write data.In Fact i am trying to make log file when user plug usb device in system that time i write data in file.I use
odevicechange() for usb device.
Plese help me
|
|
|
|
|
Boost2010 wrote: Plese help me
With what? You've posted twice now and still haven't described the problem.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Here is code
void CTestDlg::UpdateDevice(PDEV_BROADCAST_DEVICEINTERFACE pDevInf, WPARAM wParam)
{
ASSERT(lstrlen(pDevInf->dbcc_name) > 4);
CString szDevId = pDevInf->dbcc_name+4;
int idx = szDevId.ReverseFind(_T('#'));
ASSERT( -1 != idx );
szDevId.Truncate(idx);
szDevId.Replace(_T('#'), _T('\\'));
szDevId.MakeUpper();
CString szClass;
idx = szDevId.Find(_T('\\'));
ASSERT(-1 != idx );
szClass = szDevId.Left(idx);
CString szLog;
CString szTmp;
if ( DBT_DEVICEARRIVAL == wParam )
{
pendrive++;
if(pendrive==1)
{
}
else
{
szTmp.Format(_T("Adding %s\r\n"), szDevId.GetBuffer());
pendrive=0;
szTmp.Trim();
int nPos=szTmp.Find("_");
CString cyt1=szTmp.Left(szTmp.GetLength()-nPos);
CString cyt2=cyt1.Right(cyt1.GetLength()-nPos-1);
CString fi=cyt2;
int rep=fi.Replace("&PROD_"," ");
int nPon1=fi.Find("&");
final=fi.Left(nPon1);
}
} else
{
pendrive++;
if(pendrive==1)
{
}
else
{
szTmp.Format(_T("Removing %s\r\n"), szDevId.GetBuffer());
szDevId.ReleaseBuffer();
szTmp.Trim();
int nPos=szTmp.Find("_");
CString cyt1=szTmp.Left(szTmp.GetLength()-nPos);
CString cyt2=cyt1.Right(cyt1.GetLength()-nPos-1);
CString fi=cyt2;
int rep=fi.Replace("&PROD_"," ");
int nPon1=fi.Find("&");
CString finalep=fi.Left(nPon1);
char dateStr [9];
char timeStr [9];
_strdate( dateStr);
_strtime( timeStr );
CString date=dateStr;
CString time=timeStr;
CString datatime=date;
datatime+=" ";
datatime+=time;
CStdioFile myFile,myFilereport;
CFileException e;
if( myFile.Open( ""C:\\Documents and Settings\\All Users\\Documents\\Adminfile.txt"", CStdioFile::modeCreate | CStdioFile::modeWrite | CStdioFile::modeNoTruncate, &e ) )
{
myFile.SeekToEnd();
myFile.WriteString("======================================================================================================\n");
myFile.WriteString(" Disconnect infmation");
myFile.WriteString("\n");
myFile.WriteString("======================================================================================================\n");
myFile.WriteString("USB Devidce ID:");
myFile.WriteString(finalep);
myFile.WriteString("\n");
myFile.WriteString("USB Devidce Connection Time:");
myFile.WriteString(datatime);
myFile.WriteString("\n");
myFile.WriteString("======================================================================================================\n");
myFile.WriteString("\n");
}
}
}
szLog.Append(szTmp);
szLog.Trim();
if ( _T("ROOT") == szClass ) {
return;
}
DWORD dwFlag = DBT_DEVICEARRIVAL != wParam ?
DIGCF_ALLCLASSES : (DIGCF_ALLCLASSES | DIGCF_PRESENT);
HDEVINFO hDevInfo = SetupDiGetClassDevs(NULL,szClass,NULL,dwFlag);
if( INVALID_HANDLE_VALUE == hDevInfo ) {
return;
}
SP_DEVINFO_DATA spDevInfoData;
if ( FindDevice(hDevInfo, szDevId, spDevInfoData) ) {
DWORD DataT ;
TCHAR buf[MAX_PATH];
DWORD nSize = 0;
if ( SetupDiGetDeviceRegistryProperty(hDevInfo, &spDevInfoData,
SPDRP_FRIENDLYNAME, &DataT, (PBYTE)buf, sizeof(buf), &nSize) ) {
} else if ( SetupDiGetDeviceRegistryProperty(hDevInfo, &spDevInfoData,
SPDRP_DEVICEDESC, &DataT, (PBYTE)buf, sizeof(buf), &nSize) ) {
} else {
lstrcpy(buf, _T("Unknown"));
}
HTREEITEM hClass = GetClassItem(&(spDevInfoData.ClassGuid), wParam);
if ( NULL == hClass ) return;
HTREEITEM hChildItem = m_ctrlTree.GetChildItem(hClass);
BOOL bFound = FALSE;
while (hChildItem != NULL) {
CString* pszData = (CString*)m_ctrlTree.GetItemData(hChildItem);
if ( szDevId == *pszData ) {
bFound = TRUE;
if ( DBT_DEVICEARRIVAL == wParam ) {
break;
} else {
delete pszData;
m_ctrlTree.DeleteItem(hChildItem);
if ( !m_ctrlTree.ItemHasChildren(hClass) ) {
HeapFree(GetProcessHeap(), 0, (LPVOID)m_ctrlTree.GetItemData(hClass));
m_ctrlTree.DeleteItem(hClass);
}
break;
}
} else {
hChildItem = m_ctrlTree.GetNextItem(hChildItem, TVGN_NEXT);
}
}
if ( DBT_DEVICEARRIVAL == wParam && !bFound ) {
int n = GetClassImgIndex(&(spDevInfoData.ClassGuid));
HTREEITEM hItem = m_ctrlTree.InsertItem(buf, n, n, hClass);
m_ctrlTree.SetItemData(hItem, (DWORD_PTR)(new CString(szDevId)));
m_ctrlTree.Expand(hClass, TVE_EXPAND);
}
}
|
|
|
|
|
You've posted thrice now and still haven't described the problem.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
see my problem i am not able to write data in file when i login in limited user accout.
|
|
|
|
|
Why have you not bothered to check the CFileException object? That might give you a big clue as to what is happening.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
as i know and read some where there i found if file is created through admin then generally limited user cann't write in file.Ony Limited user have read permission.So can i change file attribute for limited user or there is any rule for create a file for all user read and write permission then please help me.
|
|
|
|
|
I have a VC6 project, class-view info file is damaged, VC6 shows:
"Cannot access the ClassView information file, ClassView information will not be available."
when opening its project file.
How to recover the damaged file?
|
|
|
|
|
close ALL your instances of VC6, check in the task manager that there are no ghost instance.
delete all ncb, aps(?), clw, ... files (all support files) from your different solutions; reload you projects and rebuild them all.
Watched code never compiles.
|
|
|
|
|
Yes, I got answer from Google, which says rebooting computer.
It is fine now.
|
|
|
|
|
includeh10 wrote: How to recover the damaged file?
You can't. Just delete the file and let it get rebuilt.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
hi,
Everybody,
i am trying to use parallel port to send data to it using vc++, i have added LED's to know if it works fine.
I have included inpout32.dll in my system32 directory and inpout32.lib is linked to my project, i have even placed inpout32.dll at my projects directory.
When the project executes, it gives no error, but output doesnot appear at LEDs.
please let me know if there are any errors in my code below, or anything that can help me to see output
#include <conio.h>
#include <stdio.h>
void _stdcall Out32(short PortAddress, short data);
int main () {
Out32(0x378, 255);
printf("DTA SENT");
return 0;
}
|
|
|
|
|
Never having used Out32()... Have you verified that 0x378 is the correct address of the parallel port on your machine (and it is enabled)? Have you ruled out hardware problems, LED's that are backwards, ground(s) not connected...
|
|
|
|
|
Yes jeron
I have made sure all about that, port is enabled, adress is 0x378,
that is only why i am getting nuts. i just cant figure out what is wrong and where is it wrong
|
|
|
|