|
Asking the same question three times in two different forums is NOT going to get you any more or better answers. Have you tried googling FLOPS or Benchmark?
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
Sorry for the repetition. I've tried alot in google. After two months of searching, I'm posting this question in this forum
|
|
|
|
|
FLOPS per second is zero if you have a constant clock rate.
Once you agree to clans, tribes, governments...you've opted for socialism. The rest is just details.
|
|
|
|
|
This seems such an obvious thing to need to do but I've failed to find any good references. Can anyone help please?
I have an MFC app which uses the Doc/View architecture. One of the document types it can display is a registered file type: the file is in a private binary format, and based on a code value in the file a config file is selected: the binary file is then rendered using the config file into a read-only text file in a CEditView within the app. OK so far? this works fine.
What I want to do is as follows. Let's say an intranet .aspx web page contains a link to the binary file, perhaps along with some summary text extracted separately. When the user clicks on the link, the view changes to the same text as would be displayed in my MFC app. What's the best way to do this? ActiveX control? other ideas?
This is a company intranet application, the binary file would be located on one of the company file servers. It is acceptable for my MFC app to require to be installed on the local machine, so any required controls/DLLs etc could be installed at the same time.
|
|
|
|
|
Paul Steane wrote: ActiveX control?
Yep
virtual void BeHappy() = 0;
|
|
|
|
|
i wrote the code in EVC++ 4.0, MFC,when i debug the code, the error occur at:
CDisplayData* pDisplayData=(CDisplayData*)pMainFrame->m_wndSplitter.GetPane(1,0);
i don't know how to solve it, please help
void CReadWriteData::DisplayAxisInfo()<br />
{<br />
...<br />
<br />
<br />
CMainFrame* pMainFrame=((CMainFrame*)AfxGetApp()->m_pMainWnd);<br />
<br />
<br />
CDisplayData* pDisplayData=(CDisplayData*)pMainFrame->m_wndSplitter.GetPane(1,0);<br />
pDisplayData->m_xAxisCor.Format(_T("%f"),fValue);<br />
pDisplayData->UpdateData(FALSE);<br />
<br />
<br />
}
i 've tried ,then i have no regret
|
|
|
|
|
i entered the GetPane(),
<br />
CWnd* CSplitterWnd::GetPane(int row, int col) const<br />
{<br />
ASSERT_VALID(this);<br />
...<br />
}
the app stopped at here
i 've tried ,then i have no regret
|
|
|
|
|
Verify that your pMainFrame != nullptr and that your splitter wnd, this in your last post != nullptr . You can also step into the ASSERT_VALID macro for more info.
|
|
|
|
|
First off I'm new to programming, so please be patient.
I'm writing a program that creates many instances of an image and randomizes their xy coordinates. My problem is I don't know how I should attach coordinate values to the array that represents the images.
Basically I want to know how I can take the image character[31] and attach coordinates to it, such that:
character[31] x = 5;
character[31] y = 7;
I want all the characters to have their own sets of coordinates:
character[32] x = 14;
character[32] y = 2;
Of course that code doesn't work, but that's what I want to do. Is this what a struct would be good for? I haven't worked with them before so a short piece of example code would be very helpful. Any help is greatly appreciated!
modified on Sunday, July 4, 2010 3:45 PM
|
|
|
|
|
You could try
struct Coordinate
{
int x;
int y;
};
const size_t numberOfCoords = 64;
Coordinate coords[numberOfCoordinates];
std::vector<Coordinate> coords(numberOfCoordinates);
Now you can use coords as the character array in your example:
coords[2].x = 1;
coords[2].y = 2;
Edit: Template argument....
home
modified on Monday, July 5, 2010 4:34 AM
|
|
|
|
|
Thank you, that was just what I wanted to do your example was very helpful and my code is now working as expected.
|
|
|
|
|
Hello,
I need to be able to make a small program that will install some software onto the main disk drive, some DLL's into the Windows folder, and make some registry keys and set some values in those keys. I am installing the software into a WinCE touch tablet from an SD card, and I plan to use C++ MFC dialog box with Embedded Visual Tools 3.0.
I need help in what functions I might use to store the software/dll's and make/set registry keys. Could someone give me a push to get started in the right direction?
Thank you
|
|
|
|
|
frqftgbdafr wrote: I need help in what functions I might use to...make/set registry keys.
See here or here.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Hi sir,
I have one abc.cpp file,where i have declared some struct variables.
struct abc{
...
....
}abc
If i want to access in another say bcd.cpp file
Any idea
what i have to do
Thanks
Raj
|
|
|
|
|
Move the structure declaration in a header file, say abc.h :
struct ABC
{
...
...
};
define the variable in the abc.cpp file, as usual
ABC abc;
declare the variable as extern in the bcd.cpp file
extern ABC abc;
enjoy.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
If i understand you correctly then you should move the declarations into a header file and then include this wherever you want your abc struct to be known.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> "It doesn't work, fix it" does not qualify as a bug report. <
> Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <
|
|
|
|
|
Hi,
I try to include
#include "stdafx.h"
class CSofphoneView : public CFormView ,
public IDispEventSimpleImpl<1, CSofphoneView,&DIID__IUccEndpointEvents>
in App & View class its working
when I create new c++ class “CCallcontrol” without base class and include
#include "stdafx.h"
class CCallcontrol :
public IDispEventSimpleImpl<1, CCallcontrol, &DIID__IUccEndpointEvents>
but its gets below error. Give me the suggestion .
c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\atlcom.h(4211) : error C2039: '_GetSinkMap' : is not a member of 'CCallcontrol'
1> d:\shanthakumar\sofphone\sofphone\callcontrol.h(9) : see declaration of 'CCallcontrol'
1> c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\atlcom.h(4210) : while compiling class template member function 'HRESULT ATL::IDispEventSimpleImpl::Invoke(DISPID,const IID &,LCID,WORD,DISPPARAMS *,VARIANT *,EXCEPINFO *,UINT *)'
1> with
1> [
1> nID=1,
1> T=CCallcontrol,
1> pdiid=& DIID__IUccEndpointEvents
1> ]
1> d:\shanthakumar\sofphone\sofphone\callcontrol.h(11) : see reference to class template instantiation 'ATL::IDispEventSimpleImpl' being compiled
1> with
1> [
1> nID=1,
1> T=CCallcontrol,
1> pdiid=& DIID__IUccEndpointEvents
1> ]
in “stdafx.h” included
#include // MFC socket extensions
#include // MFC declaration for CTreeView
#include // ATL Base
#include // ATL COM
#include // for CAtlMap
#include
Thanks&Regards
shakumar
|
|
|
|
|
Hi!
I've to tokenize a string. My string is a std::string . strtok() function expects a char*. If I use
c_str() to convert a std::string to char*, I get an error.
std::string player_data;
player_data = strtok(player_data.c_str(), ',');
If I use the above line, I get the following error:
I've to get the tokens from player_data and assign individual tokens to structure element. How to tokenize a std::string?
|
|
|
|
|
strtok needs char *, but std::string->c_str() returns a const char * and strtok cannot work on a const char * as it modifies the original string as it makes the tokens. So, you can cast it to a char * or make a copy.
|
|
|
|
|
If you cast it to char* and it works it's sheer fluke. There's a reason that c_str returns a const char * and not a char * : the char array returned by c_str is not guaranteed to be mutable. The details are implementation specific but the sort of things that might happen are:
- It works on on a particular STL implementation. Be warned however that it's not portable and could break when you upgrade.
- Changes made to the sequence are not seen in the
string . - It crashes.
The const is there to make it hard to do the wrong thing. A cast to a char * is how you go about doing the wrong thing.
Steve
|
|
|
|
|
As already suggested, c_str method returns a const char * and you cannot pass it to the strtok function.
As workarounds you may:
- Iteratively use the
string find method. - copy the
string content to a C character array (for instance using strdup ) and then use strtok on the latter.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
If you really, really, really have to use strtok and:
- don't mind mangling the string
- are using a C++0x implementation of standard string
you can use &*str.begin() as the argument to strtok. C++0x has tightened up the requirements on string a fair bit so you can get away with it.
However a better solution would be to write something that copies the lump of data you're after into it's own string or use std::regex if your compiler supports it.
Cheers,
Ash
|
|
|
|
|
someone please help me i need algo for this problem!!!
You are given an integer n. Return the smallest integer greater than or equal to n that
contains exactly k distinct digits in decimal notation
Definition
Method signature: long GetSmallestInt(long n, int k)
Constraints
n will be between 1 and 10^18, inclusive.
k will be between 1 and 10, inclusive
Examples
1) 47
1
Returns: 55
Here, k is 1, so we're looking for a number whose digits are all equal. The smallest such
number that is greater than or equal to 47 is 55.
2) 7
3
Returns: 102
We need three distinct digits here.
3) 69
2
Returns: 69
69 already consists of two different digits.
4) 12364
3
Returns: 12411
mohita dubey
|
|
|
|
|
We don't do homework here.
|
|
|
|