|
:-DSorry wrong!
I remmebered your stab at a solution for the previous problem; which is what I was refering to, when I said I forgot. But that was a totaly different problem, with a totaly different solution.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
John R. Shaw wrote:
Sorry wrong!
I remmebered your stab at a solution for the previous problem; which is what I was refering to, when I said I forgot. But that was a totaly different problem, with a totaly different solution.
Hey, no big deal anyway, but...
In this thread you presented a problem. All I said was that the problem you presented in this thread, is exactly the same one *I* mentioned in your other thread (even the same type names), and about which I offered an explanation and a solution. That's all
I wasn't saying that this problem, was the same one you had before.
John R. Shaw wrote:
But that was a totaly different problem, with a totaly different solution.
So, you found the solution? What was it?
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Jose Lamas Rios wrote:
So, you found the solution? What was it?
:-DSimple, I hit undo in the three different files involved, until it worked again. Then made the changes again with the final goal in mind.
Originaly the template compiled with out error, but it needed to be able to use a dirived class from a template that it depened on. Hince, I needed to make first template class and argument to the second template class. There was actualy a third template class that used the first two classes, so I don't know which one caused the complier to generate invalid code.
I hate not knowing, that's why I posted the original question. But when you're dealing with templates, inexact error messages can be very difficult to figure out.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
Hi everyone.
I have a problem concerning the synchronization of the audio and video stream in my directshow filter graph.
I've coded an mpeg-ts demux, which timestamps the media samples, but the data stream has many data errors and so, when there is an error the video pauses for a short while and you can see all these nice mpeg blocks, but the audio continues without interruption.
That causes a slight delay between audio and video after some error have occured.
What can I do to prevent this?
Thanks for advice,
Alex
Don't try it, just do it!
|
|
|
|
|
Hi Alexander!
I wrote a mpeg-ts demux filter.The source is DVB-s,so there is little error in the data stream.But I encounter a problem:the filter can render more than one audio streams,and render one video and one audio ES,but it can't render more than one video ES.when i connect two video out put pin to the decoder and run the gragh,there is a deadlock happens.
I dont know whether you encoutered this problem,I sincerely wait your advice.
Thank you very much!
Please dont laugh at my poor english ,I am a Chinese student
stephen young
|
|
|
|
|
i had this code in C++ and i hav converted it in VC++(MFC application)but there is some problem if any1 cn help me to sort out that problem.
In this program i hav made 3 classes
Class ineuron which is used for the input neurons
Class oneuron, used for the output neurons
Class network is created with 4 input neurons. these 4 neurons are all conected with 1 output neuron.class network has these public members
ineuron nrn[4];
oneuron onrn;
network( float a, float b, float c,float d)
{
nrn[0] = ineuron(a);
nrn[1] = ineuron(b);
nrn[2] = ineuron(c);
nrn[3] = ineuron(d);
onrn = oneuron();
...........}
i hav a problem in coverting this specific class in VC++(MFC Application)
It gives error in "=" sign.can any1 help.
|
|
|
|
|
can you provide complete error message.
|
|
|
|
|
Do the classes oneuron and ineuron have an operator = members?
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
Hello,
If network is your constructor, you can try the following:
network::network(float a, float b, float c, float d)
: nrn[0](a),
nrn[1](b),
nrn[2](c),
nrn[3](d)
{
}
This is called a construcor member initializer list. See here[^] and here[^] for more information.
This probably doesn't solve your problem, but I can't solve it since I don't know the exact problem. This "workaround" is better than solving your "operator=" problem..
Hope this helps
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
anyone here who can help me with creating a graphic editor. a design i can use to create my traveling salesman problem using genetic algorithm. a student here so im really needing your help. how i can boost my design and make it very classy. thanx a lot in advance!
marksanz
|
|
|
|
|
Hi,
After reading Michael Dunn's article on adding pages to control panel applates and after reviewing his code,based on michael's code I have tried add a page to the power manger, I changed the DllRegisterServer function
so it will register the propsheetext under the power manager (at least as microsoft publishes in the msdn) but still it does not work,
what am I missing?, is the registry key published in msdn is the currect one?
(it works when I am registering it for the Display property page)
any help will be appreciated.
STDAPI DllRegisterServer(void)
{
bool bNT = ( 0 == (GetVersion() & 0x80000000) );
CRegKey reg;
LONG lRet;
// Add ourself to the approved extensions list on NT.
if ( bNT )
{
lRet = reg.Open ( HKEY_LOCAL_MACHINE,
_T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved"),
KEY_SET_VALUE );
if ( ERROR_SUCCESS != lRet )
return HRESULT_FROM_WIN32(lRet);
lRet = reg.SetValue ( _T("Display CPL Extension"),
_T("{2F5AC606-70CF-461C-BFE1-6063670C3484}") );
if ( ERROR_SUCCESS != lRet )
return HRESULT_FROM_WIN32(lRet);
reg.Close();
}
// Add a key to have our extension loaded by the Display applet. Unfortunately
// the key is different between 9x and 2000, so it has to be done in code.
// I haven't tested this on NT 4 yet (don't have a system handy) so I don't
// know the right key to use on NT 4. For now I'll use the same key as on 2K.
TCHAR szKey [512];
wsprintf ( szKey, _T("Software\\Microsoft\\Windows\\CurrentVersion\\Controls Folder\\PowerCfg\\shellex\\PropertySheetHandlers\\TestDisplayPage"));
lRet = reg.Create ( HKEY_LOCAL_MACHINE, szKey, REG_NONE, REG_OPTION_NON_VOLATILE,
KEY_SET_VALUE );
if ( ERROR_SUCCESS != lRet )
return HRESULT_FROM_WIN32(lRet);
lRet = reg.SetValue ( _T("{2F5AC606-70CF-461C-BFE1-6063670C3484}") );
if ( ERROR_SUCCESS != lRet )
return HRESULT_FROM_WIN32(lRet);
// registers object, typelib and all interfaces in typelib
return _Module.RegisterServer(TRUE);
}
|
|
|
|
|
for example, i have a class:
class ABC
{
public:
int A
int function B(int x, int y)
}
i delcare a pinter:
ABC* abcObject
if i want to access A variable, i can use:
abcObject->A
But how i can access to variable x or variable y?
, if want to add a value to variable x or y?
or any other solution???
|
|
|
|
|
I think you will need to revise a little bit your C++ books . x and y are not variables from the class but are parameters you pass to the functionB function (without space, otherwise it won't compile).
So if you want to call the function and pass those parameters, you do like that:
abcOject->functionB(3,4);
But I don't understand really what you try to achieve...
|
|
|
|
|
I tried to recreate the problem below, but it does not generate any errors.
Problem: The original code (way to much to post) generates 'error C2039' in VC6 on testFuncB.
Q1: Has anyone seen this happen before?
Q2: What was the error message, in VC7, that followed this one.
As far as I can tell the original matches the example below:
#define _CLASS_A_ classA<T>
template<class T>
class classA
{
int n_;
public:
void testFuncA(void);
};
template<class T>
void _CLASS_A_::testFuncA(void){ n_ = 0; }
#undef _CLASS_A_
#define _CLASS_B_ classB<T>
template<class T>
class classB
{
public:
typedef T argClass;
T mT_;
void testFuncB(void);
};
template<class T>
void classB<T>::testFuncB(){ mT_.testFuncA(); }
#undef _CLASS_B_
typedef classA<char> classA_type;
typedef classB<classA_type> classB_type;
int main(int argc, char* argv[])
{
classB_type B;
B.testFuncB();
return 0;
}
I know, not enough information. Could you please take a stab in the dark anyway, any possible cause will be welcomed.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
John R. Shaw wrote:
Q2: What was the error message, in VC7, that followed this one.
Q3: What did you mean in Q2?
Just to make this post somewhat useful, the global typedefs before the main function should be read as follows:
typedef classA<char> classA_type;
typedef classB<classA_type> classB_type;
I kept wondering what purpose served those typedefs until I looked at the HTML source You may want to edit the original post.
As to why that would generate a C2039, I'm so in the dark I don't even dare to try a stab. Sorry
Hmm... actually, I'll try one. While coding with templates, I sometimes get to see puzzling compiler errors in situations like this:
typedef classB<classA<char>> classB_type;
The problem with the above code, which is isn't evident at all from the error messages it generates, is that the compiler gets confused by the two consecutive closing angle brackets and takes them for the >> operator. If you insert at least one space between them, the errors do go away:
typedef classB<classA<char> > classB_type;
Any chance your original code suffered of this problem?
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Jose Lamas Rios wrote:
Q3: What did you mean in Q2?
:-DAhhh! I asked a question a couple of days ago as to why the VC6 compiler complaned about externaly defined functions of a templated class that was defined internaly to the template class. VC7 generated an additional error that stated that the feature was not supported (a better error message). I would have assumed that VC7 would be fully compliant with the C++ standard, but apparently is is not.
Thanks for the stab, even thou it did not work. I've had to do things like that in the passed, but if you need to do that then there is some thing wrong with the compiler (and you need to note why you did it, the compiler and compiler version).
P.S. Very good, most people would not think of looking at the HTML code (to much trouble). I thought I had coverted it completely, oviously I was wrong. I have modified it so that it now makes since.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
|
Nope. But thanks for the stab!
I am going to start undoing the last changes I made, before this error started happening.
Blast It, thats alot of work, but I'll find it.;)
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
Hello Everyone,
I have been trying to add methods through ClassWizard but Its saying that "Error while updating *****.h and *****.cpp file". The methods I am trying to add are like Onselchange(), Button Clicks like OnButton4() etc. I am unable to add any. I did try following measures to solve this issue but none helped:
1. Deleted .clw and .ncb files, then added all source files to create fresh ClassWizard.
2. Looked if any file is Read-only (but none was Read-Only).
3. I tried to manually add these methods by writing AFX handlers in header file and then implementation in CPP file. But that is also not working.
Please help me about what could be wrong, what can I do to get things right ?
Thanks in Advance....................
Regards,
-- Prateek
|
|
|
|
|
I do not know what causes the problem, but it happen to me about 20 minutes ago (and many times in the past, in VC6).
Note: This solution assumes the class did not exist before exicuting the ClassWizard.
My solution:
1. Yes the ClassWizard complaned, but it still generated the file. So delete the ClassWizard generated class file from the workspace.
2. Close IDE.
3. Delete generated file.
4. Open IDE and run ClassWizard again.
Closing the IDE is important, since it is in a slightly unstable state; if it wasn't, it would have been able to update the file it just generated.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
Hi,
I think it has something to do with Default Read-Only setting of Windows XP Professional folders. What do you think ?
Regards
--Prateek
|
|
|
|
|
What do I think?
I think you're wrong (but, I could be wrong).
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
Hey everyone,
I need a map class to represent the data in a sort of network class I'm making and I've been looking at Boost graph library for this. The one feature I really need is the ability to join two graphs together, by specifying a vetex from each that should be joined with an edge. Although Boost::mutable_graph looks close to what I want, I don't see how I can implement my join/union/addition operation in an efficient manner with the boost graph operations. Does anyone have experience with this problem and know of any potential solutions for it? Any suggestions for libraries that might work? I am going to check out the Graph Template Library and see if that might support this better. I could always make a graph structure that is optimized for my operation, but that would probably take more time than just finding something preexisting that just works.
Any suggestions?
|
|
|
|
|
A rough guess:
map1[0,1] = ?
map1[0,2] = ?
...
map2[0,1] = ?
map2[0,2] = ?
...
join(map1,map2);
new_map1[0,1] = ?
new_map1[0,2] = ?
...
Possible Solution:
void shift_keys(map_type& map, map_type::size_type amt)
{
map_type new_map(map);
map_type::iterator mi = map.begin();
for( ; mi != map.end(); ++mi )
new_map[std:make_pair((mi->first).first+amt,(mi->first).second+amt)]
= mi->second;
map.swap(new_map);
}
vod join(map_type& map1,map_type& map2)
{
map_type new_map(map2)
shift_keys(map2,map1.size());
map_type::iterator mi = new_map.begin();
for( ; mi != new_map.end(); ++mi )
map1[mi->first] = mi->second;
}
This is an incomplete solution (off the top of my head). It should successfully join the two maps.
Example:
join(map1,map2);
map1[0,1] = ?
map1[0,2] = ?
..
map1[2,3] = ?
map1[2,4] = ?
...
I hope that helps you figure out the problem. Maps allow only one entry per-key; therefore, you have to change any key values in map2 that may be the same as a key values in map1 before you attempt to join them.
It may be more complicated than that, but I have essentially used simular code to join two maps.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
I want to create command buttons dynamically in an dialog based application - is this possible?
Ger
|
|
|
|
|