Answer Questions
Monah84 Is there any funciton which can tell me my computer is busy or not in vc ?
Is there any funciton which can tell me my computer is busy or not in vc Hi, I was looking through the code and did realize that the above codes are for one single processor only. I am having a HT processor. How do we modify this code to read from multiple processors or multi-core processors. Any help or references would be very helpful. I am doing this code in VC++ itself. Thanks in advance. thanks Martin - That is very kind of you to provide source code! Thank you. I noticed the source code has both a GetCpuUsage ( ) function and GetCpuUsage(LPCTSTR pProcessName) that appear to be almost identical, with one minor exception. You first start with LONGLONG lnValueDelta = lnNewValue - lnOldValue; ...Show All
kalkumar "error LNK2005"
I have the following code in my Form1.h file: #include "stdafx.h" #include <stdio.h> #pragma once struct Record { char arr[15]; }; Record theRecord; errno_t err_temp; FILE *tempfile; namespace StrToCharArr { .... //typical stuff } #pragma endregion private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { StrToCharArray(this->textBox1->Text); } }; } My StrToCharArray.cpp function is the following: #include "stdafx.h" #include "Form1.h" using namespace StrToCharArr; void Form1::StrToCharArray(String^ str) { err_temp = tmpfile_s(&tempfile); fprintf(tempfile,"%s",str); } I am g ...Show All
Mario Cano Where should I link?
Hi, I'm trying to build a DirectX program. I get linking error: main.obj : error LNK2019: unresolved external symbol _Direct3DCreate9@4 referenced in function _WinMain@16 I get the error using this line of code: g_D3D = Direct3DCreate9( D3D_SDK_VERSION); Where should I link I have the line. Althow I found my mistake on my own. I linked d3d9.lib from x64 folder instead of x86. It works, if I link it from x86 folder. fighter92 wrote: I have linked there, but it doesn't help The docs specify that library, so I'm guessing you aren't linking the right file after all. Where have you added the dependency As an alternative approach, you could tr ...Show All
stallion_alpa "Configuration is Incorrect" after SP1 installation
I just installed VS 2005 service pack 1 on VS 2005 Standard running on Windows 2000. After recompiling, my application still runs on my development system, but when I attempt to run it on any XP/non-development system I get the "configuration is incorrect" message. All systems have the latest OS updates. I have created a Visual C++ Windows Forms Application using the defaults with no modifications or code of my own. The default is /clr:pure. It is compiled as release code. When I try to run this application on an XP system I get the configuration is incorrect message. So, it appears to be some sort of problem with the service pack installation. Default references are listed as System System.Data System.Drawing Sy ...Show All
gorbett Assertion Failed in daocore.cpp in VC++
Hi, I am getting error like Assertion failed in daocore.cpp. Here i am using CDAODatabase and i am opening and closing Database properly still i am geting error while opening the database and its says void CDaoDatabase::Open(LPCTSTR lpszName, BOOL bExclusive, BOOL bReadOnly, LPCTSTR lpszConnect) { ASSERT_VALID(this); // Re-Opening is invalid. if (IsOpen()) { ASSERT(FALSE); return; } where line ASSERT(FALSE) if the IsOpen() returns TRUE. It means: my DB was ALREADY opened.but i am closing the DB properly This error is not consistence sometime it gives error in SetSQL() function which is called from open() function. If anypne having idea about this pl suggest me some solution. Hi ...Show All
Rakesh-BNPP Generate Preprocessed File, StdAfx Bug
I have a VS2005 solution/project that compiles just fine in debug/release modes with precompiled headers turned on. But the moment I also turn on the option to "generate preprocessed file," I get numerous errors stating: Error 1 fatal error C1083: Cannot open include file: 'stdafx.h': No such file or directory If I turn off the "generate preprocessed file," then the problem goes away. I am also not the first to encounter this problem, someone outlined it in the following link: http://www.eggheadcafe.com/forumarchives/vcide_general/jan2006/post26077854.asp Unfortunately, the answer given by "Dr. Dotnetsky" in the above link is erroneous - it neither solves the problem nor seems to understand the ...Show All
Jandost Khoso Getting garbage setting dialog box text
Hi Folks; I'm trying to set the text of a dialog box with SetDlgItemText. As an example I'm trying: SetDlgItemText(hwnd, IDC_F1, "Some text"); where IDC_F1 is defined as the ID for an edit box. What I'm getting is just garbage and I thought maybe it was my font but I've set it do Courier New, size 8 which I thought was pretty standard. Maybe someone could shed some light on my sitation. Sorry, it was actually SetDlgItemText(hwnd, IDC_F1, (LPCWSTR)"Some text"); Leaving the (LPCWSTR) out gave me a conversion error at compile time. OK thanks, that worked. But suppose "Some text" is actually a variable. I confess I'm new to this but I was wondering if anyone could tell me how to apply the L t ...Show All
cdolor ATL IDispEventSimpleImpl reverse order bug still present in VC++ 2005 ????
I'm cross-posting my question to this forum (original here : http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=1173728&SiteID=1 ) as it seems that ATL is also mentionned here. Sorry, if it's a bad practice ! I'm currently implementing an event sink with IDispEventSimpleImpl. I have the same problems than the ones described in KB288724 ( http://support.microsoft.com/kb/288724/en-us ), I'm receiving arguments in reverse order. What is confusing me is that this rather "old" knowledge base article applied only to Visual C++ 6.0. By looking into atlcom.h from VC++ 2005, it seems that IDispEventSimpleImpl::InvokeFromFuncInfo is the one described in the workaround section of KB288724, but I'm not sure with IDispEventImpl: ...Show All
gregg100 C2666 error - does this violate the C++ standard ?
Consider the following example below that generates the C2666 error. I believe this violates the C++ standard section 13.3.3.2 paragraph 3. Do you agree template < class Type> class MyArray { MyArray(); Type& operator []( int ); operator const Type*() const { return mpData; } Type* mpData; }; template < class Type> Type& MyArray<Type>:: operator []( int ind) { return mpData[ind]; } void SetElement(MyArray< double >& a) { unsigned int i=0; a[ i ] = 0.0; } Brian Kramer wrote: I took the error to mean that the compiler can either use the user-defined subscript operator, or the ...Show All
MessiahAndrw C++/C# InterOp and gacutil/regasm
Hello everybody, I am getting in the tough issue in my application. I hope I can get some advice from you. My application CatchAllMessages is mainly written in C++ and is used to catch messages from the internal network. I have many interfaces to display message data. But for some unlucky reason, we designed the new interface written in C# to catch a new message which has the different platform compared to messages caught in CatchAllMessages application. That's why I am using Interop to regsiter the C# DLL as the COM object. What I did was to create the DataWrapper.cpp class( in DataWrapper project ) which translates some basic data of the message, such as IPAddress and the content of the message. Then, I created the NewMessage. ...Show All
pjohnsen Problem with DialogBox-will not halt the program
Hi all. I hope this question is in the right place... I have a confirmation box in my program, and i wish for it to stop and wait for confirmation before continueing. I use this line: MessageBox(hDlg,"CONFIRM","CONFIRM", MB_YESNO | MB_ICONINFORMATION|MB_APPLMODAL); But the program keeps receiving and handling messages although it should wait for me to click on the confirmation box. What should I do to correct this Thanks in advance, Moshe The MB_*MODAL flags just disables the window(s), it doesn't prevent them from processing messages. Note how the windows still repaint themselves, they are still getting and processing WM_PAINT messages. Disabling a window just prev ...Show All
Latso Creating a common resource
I am creating an application to perform common statistical functions. I have created algorythms to execute the necessary steps in performing these functions. They are very common and I would like to centralize them so that I don't have to keep recreating them. I am a bit rusty in my C++ so I need a quick refresher here. My question is, would I create a cpp, h, or dll file to store all these functions under one class, say called Statistics Second, where do I store this file so that my compiler can find it I am running Microsoft development environment 2003, version 7.1.6030, Visual C++ .Net. The cpp and header files I can create, and I assume I do not need to compile them. I have never made a dll file, although I do understand wha ...Show All
Aravind Sundaresan OTP: Microsoft Visual C++ Runtime Library
How do I fix this error so that I can get into my Napster account without this coming up You may have installed some addins that destroyed your system integrity. But thisis a programmers forum. Please contact the vendor of your Browser roll back to a last known good installation in your system control panel. Or contact a newsgroup that supports your OS or Browser. OTP ...Show All
SureshGubba Visual Studio Designer problem, "The designer could not be shown for this file..."
I get this message from a component in a hierarchy of components: "The designer could not be shown for this file because none of the classes within it can be designed." While I edited the component file created by the IDE I did not change any of the data created by the designer which encompasses: " /// <summary> /// Required designer variable. /// </summary> System::ComponentModel::Container^ components; #pragma region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> void InitializeComponent(void) { components = gcnew System::Component ...Show All
GTrz Running dotnet applications on other machines
Hi everyone, I have a very big problem: I developed an application (with forms) in Visual C++ Express Edition (that is using .NET framework). The problem is that this application doesn't work on other machines but mine, even though they install .NET framework (version 2.0, it is about 20 MB). How is it possible How can I solve this problem Thank you very much This is unexpected. It probably needs an assembly that's installed only with the Framework SDK but I don't know which assembly. Did you add any references to your project I got the same following error message on different machines with Windows XP: "Impossible to run the application. The configuration o ...Show All
