|
Hey! Just wanted to say i'm sorry for not reacting on your post for a while, i had problems accessing the site (something with a DNS server), but i see in the mean time you got help, so...congratulations on solving the problem.
Best regards
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> If it doesn't matter, it's antimatter.<
|
|
|
|
|
Oh, and welcome to Code Project.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> If it doesn't matter, it's antimatter.<
|
|
|
|
|
My application is running fine in 32 bits. But in 64 bit my Graphics is not coming. It's a blank window appearing.
I have removed WIN32 definitions in the stdafx.h file please check it...
[code]
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
#pragma once
#ifndef VC_EXTRALEAN
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#endif
// Modify the following defines if you have to target a platform prior to the ones specified below.
// Refer to MSDN for the latest info on corresponding values for different platforms.
#ifndef WINVER // Allow use of features specific to Windows XP or later.
#define WINVER 0x0501 // Change this to the appropriate value to target other versions of Windows.
#endif
#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later.
#define _WIN64_WINNT 0x0500 // Change this to the appropriate value to target other versions of Windows.
#endif
#ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later.
#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.
#endif
#ifndef _WIN32_IE // Allow use of features specific to IE 6.0 or later.
#define _WIN32_IE 0x0600 // Change this to the appropriate value to target other versions of IE.
#endif
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#ifndef _AFX_NO_OLE_SUPPORT
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#include <afxole.h> // MFC OLE classes
#include <afxodlgs.h> // MFC OLE dialog classes
#include <afxdisp.h> // MFC Automation classes
#include <afxstr.h >
#include <atlimage.h>
#endif // _AFX_NO_OLE_SUPPORT
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
#ifndef _AFX_NO_DB_SUPPORT
#include <afxdb.h> // MFC ODBC database classes
#endif // _AFX_NO_DB_SUPPORT
#ifndef _AFX_NO_DAO_SUPPORT
#include <afxdao.h> // MFC DAO database classes
#endif // _AFX_NO_DAO_SUPPORT
#ifndef _AFX_NO_OLE_SUPPORT
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#endif
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
[/code]
I have modifed this for 64 bit
[code]
#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later.
#define _WIN64_WINNT 0x0500 // Change this to the appropriate value to target other versions of Windows.
#endif
[/code]
what should be done for this
[code]
#ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later.
#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.
#endif
#ifndef _WIN32_IE // Allow use of features specific to IE 6.0 or later.
#define _WIN32_IE 0x0600 // Change this to the appropriate value to target other versions of IE.
#endif
Please help....Thanks Sujan
[/code]
|
|
|
|
|
You shouldn't have to do this to be able to run an application in 64bit. How are you attempting to run your application in the 64bit machine? From your development environment or did you just move the executable over?
|
|
|
|
|
There is no difference in the versions between 32-bit and 64-bit flavors of an OS.
Try running the 32-bit application on the 64-bit OS and check if you see the UI properly.
If this is working, then the problem is elsewhere in the code.
Think about what other changes you have made to port the code to 64-bit.
|
|
|
|
|
I have a array of
std::pair<string, string> , i.e.
X → Y
A → B
C → D
B → C
T → X
Y → T
We can see that A → B → C →D (D is the final target) and X → Y → T → X (X is the final target) in the arry, what I want to do is change the arry to this:
X → X (X is the final target in circuit)
A → D (D is the final target)
C → D (D is the final target)
B → D (D is the final target)
T → X (X is the final target in circuit)
Y → X (X is the final target in circuit)
I'm confused about how to implement this algorithm.
Any help would be greatly appreciated!
|
|
|
|
|
how is the first array of pair created ? manually ?
What is the relationship between the first array and what you want to achieve? is there a logical progression between the two?
Ok, I've seen what you have.
will think about it
Watched code never compiles.
modified 4-May-12 9:36am.
|
|
|
|
|
It could be something as shown below -
bool GetSecond(const string& first, string& second)
{
for (int i = 0; i < ARR_SIZE; ++i)
{
if (first == arr[i].first)
{
second = arr[i].second;
return true;
}
}
return false;
}
void GetDest(const string& src, string& dest)
{
string src2 = src;
while (GetSecond(src2, dest))
{
if (src == dest)
break;
src2 = dest;
}
}
For each element in the pair call GetDest with first as the first parameter and second as the second parameter.
You may need to add other conditions to satisfy your algorithm.
|
|
|
|
|
Thank you for your reply.
Your algorithm is great!
I made some modifications, so that it's perfect now!
typedef vector<pair<char, char> > _OWN_TYPE;
_OWN_TYPE vecKey2Name;
bool GetSecond(const char& first, char& second)
{
for (int i = 0; i < vecKey2Name.size(); ++i)
{
if(vecKey2Name[i].first == vecKey2Name[i].second)
continue;
if (first == (vecKey2Name[i].first))
{
second = vecKey2Name[i].second;
return true;
}
}
return false;
}
void GetDest(const char& src, char& dest)
{
char src2 = src;
while (GetSecond(src2, dest))
{
if (src == (dest))
break;
src2 = dest;
}
}
int main()
{
vecKey2Name.push_back(make_pair('X', 'Y'));
vecKey2Name.push_back(make_pair('A', 'B'));
vecKey2Name.push_back(make_pair('C', 'D'));
vecKey2Name.push_back(make_pair('B', 'C'));
vecKey2Name.push_back(make_pair('T', 'X'));
vecKey2Name.push_back(make_pair('Y', 'T'));
for(_OWN_TYPE::iterator itr = vecKey2Name.begin(); itr != vecKey2Name.end(); ++itr)
cout << (itr->first) << " --> " << (itr->second) << endl;
for(_OWN_TYPE::iterator itr = vecKey2Name.begin(); itr != vecKey2Name.end(); ++itr)
GetDest(itr->first, itr->second);
cout << "=============================================================" << endl;
for(_OWN_TYPE::iterator itr = vecKey2Name.begin(); itr != vecKey2Name.end(); ++itr)
cout << itr->first << " --> " << itr->second << endl;
}
modified 6-May-12 6:25am.
|
|
|
|
|
Why not have a simple look-up table? Specially if the number of cases is this small...
|
|
|
|
|
Can you explain a little deeper?
The size of the arry is under 5000 in most case.
|
|
|
|
|
In my opinion
Falconapollo wrote: T → X (X is the final target in circuit)
Y → X (X is the final target in circuit)
Should be instead
T → Y
Y → Y
Am I missing something?
Veni, vidi, vici.
|
|
|
|
|
Yes. You miss something,
X → Y
A → B
C → D
B → C
T → X
Y → T
includes
X → Y
Y → T
T → X
so, it shoule be:
X → X
Y → X
T → X
|
|
|
|
|
1) X → Y
2) A → B
3) C → D
4) B → C
5) T → X
6) Y → T
Let's start from Y :
from rule (6) Y → T we reach T , then
from rule (5) T → X we reach X .
Now, I ask to you: Why we should stop here?
Why cannot we use rule (1) X → Y to reach again X and then stop (because there are no suitable rules but the consumed ones)?
Veni, vidi, vici.
|
|
|
|
|
I'm sorry for my late reply!
You are right, I made a mistake.
When X->Y Y->T T->X, it makes a cyclic reference. So, each element in the circel CAN be the terminate element.
I'm sorry for my mistake!
|
|
|
|
|
There are multiple possibilities. How do you select which one to use? Does the final targets are known beforehand. If not, how do you decide which one to use?
In your case, we can see that D is a final target because D is never on the left side of the pair. But for the other sequence, one could start with Y and end with Y (since it is a loop).
If the target are knows, then you would be able to build the result by search which item lead to the target and then repeat using the source as the new target (and the final target would be the original target).
Philippe Mori
|
|
|
|
|
If the target are knows, then you would be able to build the result by search which item lead to the target and then repeat using the source as the new target (and the final target would be the original target).
Yes, you are right.
Then, how to implent your idea into algorithm in C++?
|
|
|
|
|
- For each possible target, find immediate source. Add them (each pair) to a result list.
- For each immediate source not equal to the original target, find its own source. Add each pair to the result list.
- Recursively repeat the second step until you don't find any source distinct from the initial target.
You can remove recursivity if you like if you keep track of which pair were processed.
By the way, I assume that none of the source have multiples (immediate) targets.
Philippe Mori
|
|
|
|
|
I have no clue how this happened and how to fix it.
I am getting this error message from the compiler ( VC6.)
<b>“The source files ...cpp and ..cpp are ...both configured to produce ...pch
Project cannot be build.”</b>
I started getting this error on a file I really did not put into my project, so I deleted it.
Than this error “moved” onto a real file and I would like to fix it.
I would be most grateful if some VC 6.0 expert helps me to understand this and/ or how to fix it.
Thanks
Vaclav
-- modified 3-May-12 15:04pm.
|
|
|
|
|
Check the properties on your source files to ensure that only one is configure to create the PCH information.
Binding 100,000 items to a list box can be just silly regardless of what pattern you are following. Jeremy Likness
|
|
|
|
|
Richard,
that is exactly what the error message is saying.
I got that far.
I would not be asking here if I knew how and where to check that.
Vaclav
|
|
|
|
|
Right click on each files and select Properties.
Binding 100,000 items to a list box can be just silly regardless of what pattern you are following. Jeremy Likness
|
|
|
|
|
OK,
we are getting somewhere.
Indeed the ..pch file is in Properties of the offending source.
Now, how to get rid of it.
I suppose deleting it ( from the debug directory) won't work since it is obviously being generated by ...??
|
|
|
|
|
I think I found it.
Somehow all files were set to build precompiled header.
Thanks Richard for getting me started, I really appreciate your help.
Vaclav
|
|
|
|
|
Happy to help. I wonder how they all got set like that?
Binding 100,000 items to a list box can be just silly regardless of what pattern you are following. Jeremy Likness
|
|
|
|