Breakpoint Problem in VS71 & VS80 I'm afraid I have no idea what could be the reason for that, sorry.
-hg Tag: Visual C++ General [vc++] problem with afxdb.h Visual C++
problem having vc7.1 and vc 8.0 express on same machine Instead of copying, you can always check your PATH environment variable (type "echo %PATH%" from the command line or check the "properties" right click connection of Computer/My Computer, or check in the VC++ directories settings of the IDE) and add the appropriate directory ahead of the other (the PATH is searched from left to right and the first occurence of the file you're looking for is selected). Tag: Visual C++ General [vc++] problem with afxdb.h Visual C++
Trouble with bitmaps I hope one more adjustment will help:
HBITMAP hbmScreen = CreateCompatibleBitmap( hdcScreen , . . .); Tag: Visual C++ General [vc++] problem with afxdb.h Visual C++
Problem in Image Retrieving Thanks for your reply.
I need to bring the image data to the outside of the function. So I sent the data to the another function and write.
I do the same in Exe. When I tracing the code, the cursor move to another function with data and store it in byte array. But the image not displayed. I think that array data has not re-initialized.
So I need to know that how to re-assign that array and store that data.
Same as done in c# using Memorystream.write method. Can you suggest same in c++ Tag: Visual C++ General [vc++] problem with afxdb.h Visual C++
mouseclick event on form underlying object hi,
i have a picturebox sitting on a form
when the picturebox is clicked with the mouse, it of course raises the mouseclick event on the picturebox
is there any way to ignore the picturebox so that a mouseclick event is raised on the underlying form (as if the picturebox was transparent)
thanks Tag: Visual C++ General [vc++] problem with afxdb.h Visual C++
Command line compiler help needed!!!! I've been trying to read up on the command line compiler but havent made too much progress. I've followed every step at: http://msdn2.microsoft.com/en-us/library/ms235639(VS.80).aspx I'm using the Visual Studio 2005 cl.exe and the command cl /clr test.cpp At the top of the code I've included: using namespace System; using namespace System::IO; using namespace System::Text::RegularExpressions; The errors are "RegularExpressions : is not a member of System::Text" "RegularExpressions : a namespace with this name does not exist" "'array' : undeclared identifier." Even though I declared array within the code as "array<int>^ ia = rx->Split(line);" Tag: Visual C++ General [vc++] problem with afxdb.h Visual C++
Decorations on C++ DLL function declarations really needed? Just a small common mistake . You are using long in C/C++ and long in VB. The problem is that long in C/C++ is 32 bit and long in VB (and other .NET languages like C#) is 64 bit.
Depending on your need you must do one of the following:
1) use Integer in VB if you need 32 bit values
Private Declare Function summer Lib "C:\Program Files\Microsoft Visual Studio\MyProjects\geob\Debug\geob.dll" (ByVal num1%, ByVal num2%) As Integer
2) use long long instead of long in C/C++ if you need 64 bit values
GEOB_API long long _stdcall summer(long long, long long);
Not matching the size of the parameters results in an unbalanced stack when using stdcall but "works" with cdecl (you'll most probably get strange values for the function parameters and return value) Tag: Visual C++ General [vc++] problem with afxdb.h Visual C++
CListCtrl - ReportView - Selecting a row Viorel -
Thank you very much, it would have taken me forever to figure that out on my own. I was just not connecting those two pieces. I am satisfied with those results.
Just out of curiousity if you know, a regular selected line appears with a black background and white text, where this shows a grey background with black text. Do you know why there is a difference Tag: Visual C++ General [vc++] problem with afxdb.h Visual C++
Drawing text with different fonts on multiple lines without breaking the lines Hi,
I want to draw multiple strings with different fonts on multiple lines without breaking the lines. The output should look like a continuous line with different fonts.
For ex:
I want to draw a text string such as the below one and my window is having a size such that the text is diaplayed as shown below.
" Only two things are infinite, the universe and
human stupidity, and I'm not sure about the former.
- Albert Einstein "
Now I want to display the above string as follows with new fonts so that the end user observes the message to be continuous.
" Only two things are infinite, the universe and
human stupidity, and I'm not sure about the former.
- Albert Einstein "
Currently I have splitted the whole string into a number of substrings depending upon the required number of fonts. Then I use DrawText() to draw the strings. After drawing a string I am using GetTextExtentPoint32() to find out the SIZE of the drawn text to decide my indent for drawing the next string. While I try to do so, I get an output as below. After this the remaining text is also drawn in a jumbled fashion.
" Only two things are infinite, the universe and
human stupidity,
Please someone help me in drawing the text with different fonts on multiple lines using VC++, Windows programming.
Thanks,
Bala Tag: Visual C++ General [vc++] problem with afxdb.h Visual C++
SHFileOperation returns 1026 I am using the following code to copy files but i am unable to do so. The value function SHFileOperation retuns is 1026
char SrcPath[_MAX_PATH]; char DestPath[_MAX_PATH];
CString srcFile;//'('\0',80); CString destFile ;//('\0',80); srcFile.Format("%s%s\\0",SEARCH_DIR,FileName); destFile.Format("%s%s\\0",REPLACE_DIR,FileName);
strcpy(SrcPath,srcFile); //strcat(SrcPath,"\0"); strcpy(DestPath,destFile); //strcat(DestPath, "\0");
SHFILEOPSTRUCT shFileOperate;
shFileOperate.lpszProgressTitle = "Copy"; shFileOperate.wFunc = FO_COPY; shFileOperate.fFlags = FOF_NOCONFIRMATION | FOF_NOCONFIRMMKDIR | FOF_SIMPLEPROGRESS; shFileOperate.pFrom = SrcPath; shFileOperate.pTo = DestPath; shFileOperate.fAnyOperationsAborted = FALSE;
int ret = SHFileOperation(&shFileOperate);
if(ret == 0) { AfxMessageBox("Fine"); } else { AfxMessageBox("Error"); } Please help me out Tag: Visual C++ General [vc++] problem with afxdb.h Visual C++
Preventing dependent projects from being built You can also just right click on the c++ project in the solution explorer and select build or rebuild to build just that project (eg if you wanted to rebuild the project without rebuilding the c# project). Tag: Visual C++ General [vc++] problem with afxdb.h Visual C++
error LNK2019: unresolved external symbol - when trying to sort an std::deque Hi!
I'm migrating code from Visual Studio 2003 to Visual Studio 2005 and have run into problems with a rather simple piece of code that compiles and links fine in 2003 but fails to link in 2005.
Basically, I have a deque class that contains pointers to objects of a simple class. I defined a sorting predicate function and try to sort the queue.
Here's the essence of what I'm trying to do - I've stripped the code down to bare bones:
Code Block
class TestDeque
{
};
static bool ComparisonFunction( const TestDeque *e1, const TestDeque *e2)
{
return true ;
}
std::deque<TestDeque *> MyQueue;
std::sort(MyQueue.begin(), MyQueue.end(), ComparisonFunction);
This results with the following link error:
PMAN_ServicePool.obj : error LNK2019: unresolved external symbol "bool __cdecl o perator<<class std::_Deque_iterator<class TestDeque *,class std::allocator<class TestDeque *>,0> >(class std::_Deque_iterator<class TestDeque *,class std::alloc ator<class TestDeque *>,0> const &,class std::_Deque_iterator<class TestDeque *, class std::allocator<class TestDeque *>,0> const &)" ( $ MV $_Deque_iterator@PA VTestDeque@@V $allocator@PAVTestDeque@@@std@@$0A@@std@@@@YA_NABV $_Deque_iterato r@PAVTestDeque@@V $allocator@PAVTestDeque@@@std@@$0A@@std@@0@Z ) referenced in fu nction "struct std: air<class std::_Deque_iterator<class TestDeque *,class std: :allocator<class TestDeque *>,0>,class std::_Deque_iterator<class TestDeque *,cl *** std::allocator<class TestDeque *>,0> > __cdecl std::_Unguarded_partition<cla ss std::_Deque_iterator<class TestDeque *,class std::allocator<class TestDeque * >,0>,bool (__cdecl*)(class TestDeque const *,class TestDeque const *)>(class std ::_Deque_iterator<class TestDeque *,class std::allocator<class TestDeque *>,0>,c lass std::_Deque_iterator<class TestDeque *,class std::allocator<class TestDeque *>,0>,bool (__cdecl*)(class TestDeque const *,class TestDeque const *))" ( $_U nguarded_partition@V $_Deque_iterator@PAVTestDeque@@V $allocator@PAVTestDeque @@@ std@@$0A@@std@@P6A_NPBVTestDeque@@0@Z@std@@YA AU $pair@V $_Deque_iterator@PAVTes tDeque@@V $allocator@PAVTestDeque@@@std@@$0A@@std@@V12@@0@V $_Deque_iterator@PAV TestDeque@@V $allocator@PAVTestDeque@@@std@@$0A@@0@0P6A_NPBVTestDeque@@1@Z@Z )
If I change MyQueue to be
Code Block
std::deque<TestDeque> MyQueue;
everything's fine.
The code above seems perfectly valid to me. What am I missing here
Can anyone help This is quite easy to reproduce.
Thanks! Tag: Visual C++ General [vc++] problem with afxdb.h Visual C++
What causes this access violation? I'm having a similar error. Knowing only a little bit about programming, I don't really understand all of that. Can someone dumb it down for me and also tell me an easy way to fix it Tag: Visual C++ General [vc++] problem with afxdb.h Visual C++
Visual C++ 2005 This is a C# forum. Try your question in the C++ forum instead.
Hope this helps. Tag: Visual C++ General [vc++] problem with afxdb.h Visual C++
Memory leak It looks to me like you're trying to use a pointer that has been deallocated. Don't do that. Also, whenever possible, stick with smart pointers such as std::auto_ptr, boost: hared_ptr and so forth. Tag: Visual C++ General [vc++] problem with afxdb.h Visual C++
problem with a .exe In addition to having the appropriate .NET runtime there may be other dependencies. The easiest way to get your program working on another computer is to create setup program using Visual Studio. Select new project | Other Project Types | Setup and Deployment | Setup Project and add your project to it. Build, and use the resultant msi to install your program on other computers. Tag: Visual C++ General [vc++] problem with afxdb.h Visual C++
Are Interlocked and Barrier Intrinsics Implemented Incorrectly on VC8? Rivorus wrote:
An xchg does not guarantee any fence what-so-ever, at least as far as I can see from x86 instruction listings
According to the Intel 64 / IA-32 software development manual, XCHG instructions imply automatic locking.
As for the fence operations, I can confirm that no explicit ones are provided for volatile objects. That being said, the documentation doesn't appear to make that guarantee (and neither does volatile on any other C++ platforms I know of). The only guarantee made is for the volatile objects not to take part in any compiler re-orderings.
One part I find ambiguous in the MSDN documentation is the following statement: " Although the processor will not reorder un-cacheable memory accesses, un-cacheable variables must be volatile to guarantee that the compiler will not change memory order. " This seems to suggest that volatile objects are allocated in ranges marked as un-cachable in the processors MTRRs (memory type range registers, applicable for P4, Xeon and P6). According to the Intel docs, marking a range UC will cause the processor to enforce strong ordering on accesses to that segment. What's unclear to me about this strong ordering, is whether it only affects the un-cachable memory segments alone (that is, reads and writes to UC segments cannot be re-ordered). I doubt, however, that it also enforces serialization of reads / writes to segments *not* marked as UC, which occur (instruction-wise) in-between those to the UC segments.
The bottom line, as I see it, is that you must manually use either the fence instructions; implicitly or explicitly lock prefixed instructions; CPUID or API level lock primitives. Failure to do so may, as you note, cause cpu re-orderings to break your code on SMP architecture.
A side note, I noticed that the Orcas compiler generates volatile release build operations in a manner similar to the debug build operations in VC8: a single pre-increment of a volatile int will take the value into a register, increment the register, then write it back to the value itself. Release build apps in VC8 will skip the register step, and increment the value at the memory location in a single instruction. Tag: Visual C++ General [vc++] problem with afxdb.h Visual C++
About XmlTextWriter Post your issue in the XML and the .NET Framework forum. They can better help you. Tag: Visual C++ General [vc++] problem with afxdb.h Visual C++
Problem opening a fiel using fopen_ This warning is only ... a warning. The fopen() is still here and will be here.
If your fopen() fails then I'm really surprized since the code you showed (assuming the one using fopen() was correct) has no reason to fail.
The sharing problem could occur if the file was already opened, but if you say that nobody uses it then there is no reason why fopen() could return errno = 2 (file not found.)
I would guess that you don't have read access to the file since it is in the windows/ directory but then why would Borland's function work for you !
Can you simply notepad the file As the same user as one that runs your program that fails
Greg. Tag: Visual C++ General [vc++] problem with afxdb.h Visual C++
Cannot handle preprocessor definition on 64bit platform I can compile a project successfully on x86 platfomr. When I switch to x64 config, I got the following error when compiling:
Error 1 fatal error C1083: Cannot open source file: 'NO_CONFIG_READER': No such file or directory File: c1xx
This error sounds wired since ¡°NO_CONFIG_READER¡± is not a file. It is a preprocessor definition defined in the project property. Any hints
Thanks, Tag: Visual C++ General [vc++] problem with afxdb.h Visual C++
New to VC++ Programming thanks 4 ur reply, well want to know what type damage can happen if i make any mistake Tag: Visual C++ General [vc++] problem with afxdb.h Visual C++
Simple code: Which way is best practise? I think it's because this is just a style question with no best answer. In cases like these you should excercise your own judgment and use what you think is the better choice. Tag: Visual C++ General [vc++] problem with afxdb.h Visual C++
convert struct from 2 dimensions to 1 in order to marshal to managed code given the struct sJoint here in some 'unmanaged code' that I need to access via vb.net through interop. I saw a post from Peter Huang (Microsoft Online Partner Support) who said "We can not marshal a structure with a two dimensions array inside, we need to treat it as a single dimension array . "
Based on my observations tracing through vb.net code after the marshalling occurred when trying to use two dimensional arrays, I would agree. The struct used in the marshalling that is passed as a paremeter into calls to the C++ from the vb.net is the blue code below; Looks like I need to convert the C++ dAxes declaration to a single dimensioned array so it can be consumned on the other side of the managed/unmanaged boundary. How will I convert code such as the line of SimmJoint->universal.axis [0] = Joint->dAxes [0] below Thanks ! Greg
Code Snippet
typedef struct sJoint { double dAxes[3][3]; } sJoint;
SimmJoint->universal.axis[i][0] = Joint->dAxes[i][0];
< StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Ansi)> Public Structure Joint <VBFixedArray(2, 2), System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValArray)> Public Axes(,) As Double Public Sub Initialize() ReDim Axes(2, 2) End Sub End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Ansi)> Public Structure Segment Public Joint As SolverJoint
Public Sub Initialize() Joint.Initialize() End Sub End Structure Tag: Visual C++ General [vc++] problem with afxdb.h Visual C++
Difficulties with error codes C2504 and C2248 Do you have lines like #include "stdafx.h" in your CPP files and can you confirm that your H files are included after stdafx.h
And can you remove #include "Visitor.h" from Expr.h Tag: Visual C++ General [vc++] problem with afxdb.h Visual C++
All is fine in release mode, weird bug in debug mode That's all well and good, but I really think you should step through the disassembly (and particularly the stos) to verify exactly where the corruption is. Tag: Visual C++ General [vc++] problem with afxdb.h Visual C++
C++ Interop (/CLR) - Error LNK2028 No, I don't think I have the same problem, but thank you for the suggestion. If I learn anything, or resolve it, I will update the post.
Cheers,
Jan Tag: Visual C++ General [vc++] problem with afxdb.h Visual C++
namespace questions Namespace do not get rid of the need to #include the header file where the definition of the class resides. The last two errors seems to indicate that you have some pretty messed up code - could you show us an example Tag: Visual C++ General [vc++] problem with afxdb.h Visual C++
nafxcwd.lib unavailable - 32-bit version MFC libraries only ship with Visual C++. At some point the SDK provided prerelease toolchains were the only way to build applications targeting x64 & IA-64 and therefore did include MFC and ATL libraries.
You'll need a Visual C++ or Visual Studio installation (VC++ Express also doesn't ship with MFC & ATL)
-hg Tag: Visual C++ General [vc++] problem with afxdb.h Visual C++
bry555
I'm using visual c ++ express. I'm trying to connect to a database I configured with sql serveur express. I'm using CDatabase and CRecordSet function so I belive I need #include <afxdb.h>, but when I compile I get an error saying that there is no such file or directory. Can any one help