-
- SetTimer problem for TCP/IP packet sending
by _Chrissy_
- 5 Replies
- Last post
by _Chrissy_
- Hi all, I am working on a network trafic generator and for a certain type of flow there is a certaine amount of time between each packet, the Inter Packet Gap.
Code Snippet
void send_time (int tpflow, int fid, long plength) { /* calls a random sending time and sets a timer to count down that value, when it is done, it sends the packet */ MSG msg; SetTimer (hwnd,
-
- Capitalize letters in strings
by Jerry584894
- 9 Replies
- Last post
by Marius Bancila
- How do I capitalize the first letter in a string
-
- I can't get the Wnd of a toolbar button
by Menelaos Vergis
- 7 Replies
- Last post
by Menelaos Vergis
- I want to get the Wnd of a toolbar Button and it is not possible. I create a CToolBar object and it is working corectly but when i want to get the Wnd of button it returns NULL. CToolBar m_wndEditBar; m_wndEditBar.GetDlgItem(ID_ESTIMATOR) == NULL and ((CMainFrame *) AfxGetMainWnd())->GetDlgItem(ID_ESTIMATOR) == NULL How can I get the Wnd of a ToolBar Button
-
- problem with PostMessage error #87
by Rakesh Simpi
- 7 Replies
- Last post
by Pintu Shukla
- hi there! i am developing an application in which i need to let UI know about some events.. I've chosen windows messages to that for me. this is how my code looks like..... WCHAR* t = L"MyAppli"; HWND handle = FindWindow(NULL, t); //always succeeds in acquiring the window handle LRESULT l = SendMessage(handle , 8686, 1, 1); if(l==0) { DWORD er = GetLastError();
-
- how to store data of distinct datatype at runtime?
by manish_mnp
- 7 Replies
- Last post
by Andreas Masur
- I want to store data of distinct datatype at runtime. so how can i do this Is there any provision for this kind of support in MFC Thanks in advance
Manish Patel B.E. - Information Technology
-
- location of output libraries
by jph2667
- 3 Replies
- Last post
by RokitMan
- I am using Visual Studio 2005. I am not using .Net My current situation is that I have a group (about 16 projects) of libraries that need to be compiled. I would like all the output .lib files to be in one directory, so when I or another person in my development team references certain libraries they will only need to point to a single location. I have tried many project settings, however they see
-
- Using .NET assembly in win32 Application
by preeteesh Kakkar
- 10 Replies
- Last post
by crescens2k
- Hi, I need to use a code developed in .NET in a C++ Application. I don't want .NET assembly to be converted to a COM server and register it using regsvr32 instead i want it to be converted to win32 dll so i can directly use it from any C++ project. I just need to expose some API in .NET assembly to my Win32 C++ Applictation. Please let me know.
-
- Difficulties with error codes C2504 and C2248
by B McDowell
- 6 Replies
- Last post
by B McDowell
- Hello, I am currently having two errors that I just can't seem to figure out. The first is error code C2504 " 'Expr' base class undefined" and the second is error code c2248 " 'Expr' :: 'Expr' cannot access private member declared in class 'Expr'."
My program uses a hierarchy of classes to store mathematical expressions, which can be evaluated using a visitor class. Expr
-
- file delete
by emcsquared
- 5 Replies
- Last post
by einaros
- I have an existing ascii file that I am able to delete using:
remove("file_1.dat").
However, if I rename "file_1.dat" with:
rename(file_1, file_2)
and then try and remove "file_2.dat", I get a permission denied error. I have full permissions in the working folder. Seems like Ioose the ability to delete after I rename it.
Thanks
-
- scope problem
by no_penguins
- 2 Replies
- Last post
by Marius Bancila
- hey all have a scope problem, simple example is here: #include <iostream> #include <windows.h> namespace { class test_2 { public: char external_1[30]; test_2() { ::SecureZeroMemory(&external_1, sizeof external_1); }; }; }; namespace { class test_1 { public: void assign(test_2 object) { cha
-
- stdio.h errors in Visual Studio 2005
by Death_oClock
- 14 Replies
- Last post
by Brian Kramer
- I just finished installing VS 2005 (is it that hard for microsoft to just let people download like, a zip file of it, rather than an img file, which i had no idea what to do with at first ) and tried the following code:
#include <stdio.h> // include the standard input/output header file void main(void) // our program starts here { printf("Hello Worl
-
- Mixed Mode : Should definitions be in the headers when creating static mixed lib?
by Sunkyu Hwang
- 4 Replies
- Last post
by Sunkyu Hwang
- Hello,
I am trying to use some .NET stuffs inside already existing native C++ source pool.
I experienced wierd "unresolved symbol" error and ultimately solved the problem but cannot explain why.
Could anyone please tell me what I did Thank you very much,
[ Problem Source Files ]
MixMode.lib (static lib created with /clr)
// ========= "MixMe.h&q
-
- error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
by reena vade
- 10 Replies
- Last post
by reena vade
-
- Odd syntax error on compile, known good code
by Chazcon
- 9 Replies
- Last post
by Damien Watkins - MSFT
- I'm using Visual C++ 2005 Express Edition to edit, and Visual C++ 2003 Toolkit to compile, using a makefile.
The code I'm working on is from publicly released SDK for a game (Firaxis' Civilization IV). The code was written in Visual C++ 2003, thus the workaround.
I've done a great deal of editing and have sucessfully compiled over 100 .dll's - just last night I produced a build, tested it in
-
- Debug Assertion Failed! _CrtIsValidHeapPointer( pUserData )!!!
by Shouvik
- 7 Replies
- Last post
by Shouvik
- Hi, I have a Win32 Console Application which is throwing the Debug Assertion Failed! .. _CrtIsValidHeapPointer( pUserData ) and followed by a Debug Assertion Failed! .. _BLOCK_TYPE_IS_VALID(pHead->nBlockUse). After I did a Step by Step Debug strangely what I saw was it is throwing error once it is exittin the main function. Unlike any character pointers and deletion of heap without its referenc
-
- Memory leak issue
by Dami
- 11 Replies
- Last post
by Dami
- Hi, I have stuck into this problem. I want to remove memory leaks from my program, but the following error is occuing on the delete[] statement in the following code segment. Unhandled exception at 0x1020a702 (msvcr71d.dll) in IEXPLORE.EXE: 0xC0000005: Access violation reading location 0x03acfffc. if (m_pbits != NULL) { delete[] m_pbits; m_pbits = NULL; } m_pbits = new BYTE[rec
-
- A very strange exception problem
by hipswich
- 14 Replies
- Last post
by hipswich
- Hi all,
I have a very weird problem and hope someone can shed some light on this. I have two statements if (A == B) and if (bFlag) that seem to be fine no matter whether I check them separately or their combination. Int the the following code, exception is caught only at location 5 repeatedly. No exception has ever been caught at other locations. I cannot make any sense out of it.
-
- Trying to add manifest to DLL using Visual C++ 6.0
by SupaFly
- 3 Replies
- Last post
by narkony
- I have a DLL that is used to kill off a process when an application is shut down. This DLL is failing on Vista due to lack of permission. I have been looking all over the internet for details on how to handle this, and adding a manifest seems to be the best solution. Unfortunately, all of the sites that I found dealing with manifests talk about using Visual Studio 2005 or later. I am stuck using V
-
- Structured Exception handling is not working in Release mode
by benwestgarth
- 6 Replies
- Last post
by benwestgarth
- Hi there, I have seen questions similar to this posted on this forum before, but none of the responses have solved my problem. I have some code as such:
__try {
// cause exception for testing
char* sz = NULL;
tstrcpy(sz, "foo"); } __except(EXCEPTION_EXECUTE_HANDLER) {
// handle and alert // ... } If I run in debug mode then my exception block is properly execute
-
- VS 2005 STL Vector implementation slower than plain array?
by n0n4m3
- 2 Replies
- Last post
by vbvan
- Hi, yesterday a friend of mine was testing stl vector against a plain array and I thought that the access time would be very similar in both through the operator[] but the times from both tests were very different (much slower in the stl vector). In debug it makes sense because it may perform several tests to check whether we're accessing a valid index but in release it was also much slower than t
-
- Input/Output (save/load files)
by Jerry584894
- 8 Replies
- Last post
by Simple Samples
- this is my file:
Code Snippet
#include <iostream> #include <cstdlib> #include <string> #include <afxwin.h> using namespace std;
void main() { char* pszFileName = "\test.dat"; CFile myFile;
if ( ! myFile.Open( pszFileName,CFile::modeCreate | CFile::modeReadWrite)) { TRACE( "Can't open file %s\n",pszFileName); } }
Howeve
-
- LNK4248 - unresolved typeref token
by Alex Farber
- 4 Replies
- Last post
by A Mulay
- I have the following warning building my C++/CLI project: CameraPike.obj : warning LNK4248: unresolved typeref token (0100002D) for 'CCamera'; image may not run
It is shown only in Release configuration. Program runs successfully. Project doesn't have CCamera class or variable. There is Camera class. Both CameraPike and Camera classes work with unmanaged libraries. I cannot find any reason for
-
- sort vector of struct first by then by
by alkatal
- 2 Replies
- Last post
by alkatal
- hi i have the following struct
struct example
{
std: tring a;
int x1;
double x2 ;
int x3;
std: tring b;
}
need to sort a vector of this struct first by a then by b like the sort tool in excel.
i tried this
class sorting
{
bool operator()(const example & s,const example &t)
{
s.a<t.a &&s.b<t.b
}
-
- Need Help
by KeeperMustDie
- 7 Replies
- Last post
by TilakGopi
- Hi, I want to ask how to add System::String ^MyVar, as an global variable. Anyone knows
-
- Module tab says: the module did not load at the default load address
by 3Nu
- 3 Replies
- Last post
by Simple Samples
- I make a simple project using
#define DLLEXPORT __declspec ( dllexport )
I've 3 projects in 1 solution, and 2 of them are .dll, 3rd instead uses first 2 libraries, is an application. When I build project i can read in Module Tab (bottom) the module did not load at the default load address width an exclamation (!) for 2nd project, instead 1st project loads correctlly. Infact if i try to