|
I think those two functions also stroing the value under the registry only.
|
|
|
|
|
Hello,
since VC++ 6 doesn't work anymore on my SP2 XP system, and I have to make
some changes to an old project I decided to convert it to .NET 2003.
So I clicked on the .dsw file and am getting those error messages:
"The project file 'XXX' has been corrupted and cannot be opened".
There are about 20 projects in that workspace and it seems (thanks to Microsoft),
that I cannot import them.
Is there any kind of converter program which I could use to convert all of those
.dsp files to .cvproj? It would take hours to rebuild the whole workspace.
Rainer
|
|
|
|
|
I think there is something wrong with your system.
1) Visual Studio 6 runs fine under WinXP SP2
2) When you try to open a VC6 project with Visual Studio.NET a messages comes up asking if you want to convert it to the new format and when you choose yes everything works fine.
So, to my experience, you have another problem.
MS
|
|
|
|
|
.dsw and .dsp files are text files. If you open them with a text editor, you'll see:
DSW:
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "blah"=.\blah.dsp - Package Owner=<4>
Package=<5>
{{{
begin source code control
$/path/to/blah
.
end source code control
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
begin source code control
$/path/to/blah
.
end source code control
}}}
Package=<3>
{{{
}}}
###############################################################################
DSP:
# Microsoft Developer Studio Project File - Name="blah" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=blah - Win32 Release
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "blah.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "blah.mak" CFG="blah - Win32 Release"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "blah - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "blah - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName "$/path/to/blah"
# PROP Scc_LocalPath "."
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "blah - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
continues... If you can't open it in a text editor, or there are odd characters in the file, the file has indeed become corrupted. You should restore from a known good backup - and run the Windows Memory Diagnostic[^] to ensure your system RAM is OK.
If your system RAM is OK, consider replacing your hard disk.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Dear Frineds,
I have a small Query in VC++ ,I will highly appreciate if you please
suggest me some solution.
I have an MDI, Document/View Architecture ,"Full Server Active Document Server " Application.
In this application I have 5 toolbars which I a docking side by side .
I am creating a document inside this application and saving it let us say "test.tsd"
Now when I open this document in MSWORD ,I see the item in MSWORD but I cannot see the toolbar docked side by side in MS Word Applciation.
Because when you double click any item in MSWORD then toolbars of MSWORD should be replaced by server Application but I am not able to see the toolbars docked side by side.
There is sample application in MSDN (Hiesvr) mfc_ole_hiersvr.zip . But this application does not
show how in dock toolbar side by side in case of In Place Activation
Can you please suggest any solution (or any sample if you have ) for this problem.
My email address is rajeevkanta@hotmail.com
with thanks
regards
Rajeev Garg
|
|
|
|
|
moved working application compiled on win 2k sp3 and visual C++ sp5 to win 2k sp4 compiled and run . the application fails immediatly with access violation.
try to put sp6 for visual did not help!
anyone can help?????????
attiasgabi@hotmail.com
|
|
|
|
|
moved working application compiled on win 2k sp3 and visual C++ sp5 to win 2k sp4 compiled and run . the application fails immediatly with access violation.
try to put sp6 for visual did not help!
anyone can help?????????
|
|
|
|
|
Likely a bug in your code that has always been there and decided today is the day to show up. Debuggers were created to help track down such problems and VC has a very good one.
Neville Franks, Author of ED for Windows www.getsoft.com and Surfulater www.surfulater.com "Save what you Surf"
|
|
|
|
|
dear neville
stop shuving your ED, it is not the place. THANKS FOR YOUR HELP
|
|
|
|
|
when i run this code,message box appear "out of memory error".
someone please explain me.Why?
following my code--->>
void CIPAddressDlg::OnButton1()
{
CListBox *pList = (CListBox*) GetDlgItem(IDC_LIST2);
pList->ResetContent();
PMIB_IPNETTABLE pIPNetTable = NULL;
PMIB_IPNETROW pIPNetRow;
in_addr ia;
char *szTypes[4] = {"Other", "Invalid", "Dynamic", "Static"};
GetIpNetTable((PMIB_IPNETTABLE) m_pBuffer, &m_ulSize, TRUE);
m_pBuffer = new BYTE[m_ulSize];
if (NULL != m_pBuffer)
{
pList->AddString("Start get ip net table");
m_dwResult = GetIpNetTable((PMIB_IPNETTABLE) m_pBuffer, &m_ulSize, TRUE);
if (m_dwResult == NO_ERROR)
{
pIPNetTable = (PMIB_IPNETTABLE) m_pBuffer;
for ( unsigned int x = 0; x < pIPNetTable->dwNumEntries; x++)
{
pIPNetRow = &(pIPNetTable->table[x]);
m_strText.Format(" Index: %lu\r\n", pIPNetRow->dwIndex);
pList->AddString(m_strText);
m_strText.Format("MAC address length: %lu\r\n", pIPNetRow->dwPhysAddrLen);
pList->AddString(m_strText);
m_strText.Format(" MAC address: %02x-%02x-%02x-%02x-%02x-%02x\r\n",
pIPNetRow->bPhysAddr[0],
pIPNetRow->bPhysAddr[1],
pIPNetRow->bPhysAddr[2],
pIPNetRow->bPhysAddr[3],
pIPNetRow->bPhysAddr[4],
pIPNetRow->bPhysAddr[5]);
pList->AddString(m_strText);
ia.S_un.S_addr = pIPNetRow->dwAddr;
m_strText.Format(" IP address: %s\r\n", inet_ntoa(ia));
pList->AddString(m_strText);
m_strText.Format(" Type: %s\r\n", szTypes[pIPNetRow->dwType - 1]);
pList->AddString(m_strText);
}
}
else
{
m_strText.Format("GetIpNetTable() failed.Result = %lu\r\n", m_dwResult);
pList->AddString(m_strText);
}
delete [] m_pBuffer;
}
}
|
|
|
|
|
vc-programmer- wrote:
GetIpNetTable((PMIB_IPNETTABLE) m_pBuffer, &m_ulSize, TRUE);
m_pBuffer = new BYTE[m_ulSize];
This is strange
typedef struct _MIB_IPNETTABLE {
DWORD dwNumEntries; // number of entries in table
MIB_IPNETROW table[ANY_SIZE]; // array of ARP entries
} MIB_IPNETTABLE, *PMIB_IPNETTABLE;
Le Ridder Noir
Considderd to be the worlds fastest knoppenbonker.
three years of working experience with the worlds fastest copie paster(about 2000 lines a minute).
And experience with the one and only NewEra Guru and Crystal Ace.
|
|
|
|
|
The problem is that m_ulSize (assuming that's a class member) is default-initialised by the debug memory allocator to 0xcccccccc, and you've not set it the first time you use it. GetIpNetTable says that's big enough (and incidentally writes the table to the garbage pointer you probably provided as the first argument) and doesn't set m_ulSize to anything. You then try to get new to allocate a huge buffer, which fails and produces the 'out of memory' error.
In C and C++, you must always initialise every variable you use. Failing to do this inevitably leads to some problem where you've used an uninitialised value.
Since the lifetime of the buffer pointed to by m_pBuffer is the length of this method (you delete it at the end), I'd make m_pBuffer a local variable instead. I'd also make m_ulSize a local variable, along with m_strText.
Something you've not considered is that the size of the table can change between calls to GetIpNetTable. If another ARP request occurs between the calls, the size will change. A common way of handling this problem is simply to use a while loop, quitting when the error is no longer ERROR_INSUFFICIENT_BUFFER.
A fixed version follows:
void CIpNetTableDlg::OnButton1()
{
CListBox *pList = (CListBox*) GetDlgItem(IDC_LIST2);
pList->ResetContent();
PMIB_IPNETTABLE pIPNetTable = NULL;
PMIB_IPNETROW pIPNetRow;
in_addr ia;
char *szTypes[4] = {"Other", "Invalid", "Dynamic", "Static"};
BYTE* pBuffer = NULL;
ULONG ulSize = 0;
DWORD dwError = GetIpNetTable((PMIB_IPNETTABLE) pBuffer, &ulSize, TRUE);
CString strText;
while ( ERROR_INSUFFICIENT_BUFFER == dwError )
{
delete[] pBuffer;
pBuffer = new BYTE[ulSize];
if ( pBuffer == NULL )
break;
dwError = GetIpNetTable((PMIB_IPNETTABLE) pBuffer, &ulSize, TRUE);
}
if ( dwError == NO_ERROR )
{
pIPNetTable = (PMIB_IPNETTABLE) pBuffer;
for ( unsigned int x = 0; x < pIPNetTable->dwNumEntries; x++)
{
pIPNetRow = &(pIPNetTable->table[x]);
strText.Format(" Index: %lu", pIPNetRow->dwIndex);
pList->AddString(strText);
strText.Format("MAC address length: %lu", pIPNetRow->dwPhysAddrLen);
pList->AddString(strText);
strText.Format(" MAC address: %02x-%02x-%02x-%02x-%02x-%02x",
pIPNetRow->bPhysAddr[0],
pIPNetRow->bPhysAddr[1],
pIPNetRow->bPhysAddr[2],
pIPNetRow->bPhysAddr[3],
pIPNetRow->bPhysAddr[4],
pIPNetRow->bPhysAddr[5]);
pList->AddString(strText);
ia.S_un.S_addr = pIPNetRow->dwAddr;
strText.Format(" IP address: %s", inet_ntoa(ia));
pList->AddString(strText);
strText.Format(" Type: %s", szTypes[pIPNetRow->dwType - 1]);
pList->AddString(strText);
}
}
else
{
strText.Format("GetIpNetTable() failed.Result = %lu", m_dwResult);
pList->AddString(strText);
}
delete [] pBuffer;
}
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Is it that GetKeyState can be used only for Toggle keys and control keys like alt,ctrl, Esc , Enter .etc...
Can i use GetKeyState function to get the state of alphabet keys like A - Z or a -z... If so how ?? The argument passed should be the scan code of the character or Virtual Key codes ??? Plz help...thank u
|
|
|
|
|
You need to test if the Shift Key is down - VK_SHIFT from memory. Also CapsLock.
Neville Franks, Author of ED for Windows www.getsoft.com and Surfulater www.surfulater.com "Save what you Surf"
|
|
|
|
|
Can someone explain me how to do this ?? plz....with a simple sample code...thank u
|
|
|
|
|
Sure:
#define KEY_DOWN( X ) ( (X) & 0x8000 )
BOOL
kb_shift_down()
{
return KEY_DOWN( GetKeyState( VK_SHIFT ) ) != 0;
}
Neville Franks, Author of ED for Windows www.getsoft.com and Surfulater www.surfulater.com "Save what you Surf"
|
|
|
|
|
Thanks for ur patience friend...But still my doubt was how to get the key state of alphabet keys...ie A-Z or a-z ...
should i give as GetKeyState('A') or
GetKeyState(Scancode of the character)
Thank u
|
|
|
|
|
|
Yes , i can understand friend...but this case works out in a single machine..But in Client and Server concept it fails..I use the same GetKeyState() fn to retrieve the keystate...I check for its return value...
getKey = ::GetKeyState(vk);
if(getKey & 0xF000)
printf("%c pressed 0xF000\n",tempbuffer[c]);
else if(getKey & 0x000F)
printf("%c releases 0x000F\n",tempbuffer[c]);
else if(getKey & 0x0001 == 0x0001)
printf("%c Key is toggled\n",tempbuffer[c]);
else if( getKey & 0x8000 == 0x8000)
printf("%c Key is pressed\n",tempbuffer[c]);
else
printf("%c key is neither pressed nor toggled",tempbufferc]);
}
For the above cases
for some of the characters condn. fails and so the message
"Key is neither pressed nor toggled " message gets printed.
What can i do for this ?
Thank u
|
|
|
|
|
When using cdhtmldialog in MFC, the default html file is embedded in the resource. But can I load the html file somewhere in my local machine? thanks for reading.
|
|
|
|
|
|
In VC6, you could add an "Active Document Server" to your project, which would open an in-place-editor in the Devstudio IDE. (With all thebenefits like automatic saving when starting a build)
Can anything similar be done in VC7.1? ADS don't seem to work at all. How?
I never really know a killer from a savior boost your code || Fold With Us! || sighist | doxygen
|
|
|
|
|
If I want to detect the activity(Playing or Recording) of audio device, how can I do?
Is there any Windows API function, Service, or Driver solution?
In addition, how to detect the activity of devices like bluetooth, wireless...etc
|
|
|
|
|
Hi folks,
I have cretaed an SDI application in vc++.
Now i want to change the font of text in the title bar.
How do i do that?
|
|
|
|
|
use CWnd::SetWindowText() function.....
hope that helpz.....
cheerz.....
|
|
|
|