|
I'm looking forward for buying a mac, I will start game development but what is the best mac for programming in C++?
|
|
|
|
|
|
Best mac for visual C++? ...none really. Visual C++ is pretty much the name of the C++ compiler for Windows, so your question is a bit of a contradiction.
|
|
|
|
|
Hello community,
i call/open a help-file from my program, this works fine,
only one thing i can't resolve:
on the help file, if i select a next tab(on the left side), for example tab to search in help content, and close file.
Any next start of that file is the last selected tab from previous call. And that is my problem: how to call the help file with selected first tab item, this is how i call a help file:
<br />
HWND hwndHelp = ::HtmlHelpW(m_hWnd, csPathToHelpFile, HH_DISPLAY_TOPIC, dwTopic);<br />
Helpfile is opened, the right topic is shown, but the tab who is selected is the last one of the previous call, how to set the selected Tab to first index?
I found this in "HtmlHelp.h": HH_DISPLAY_CONTENT, is this a key to show first tab with topics?
Thanks in advance
bosfan
|
|
|
|
|
Hi,
The code below fails to get any input pins for the filter "Mp3 Decoder DMO".
The class ID for the specific filter is {94297043-BD82-4DFD-B0DE-8177739C6D20} . Specifically, it fails at the very first while condition. I get S_FALSE which means "Did not retrieve as many pins as requested."
Does it play any role that this specific filter is DMO (Direct Media Object) filter ? If this is the case, is there nay other way to get the input pins ?
In my graphedit it connects and works just fine , but under my code it fails. Any recommendations ?
IPin* Graph::GetPin(IBaseFilter *pFilter, PIN_DIRECTION PinDir, UCHAR PinCounter) {
BOOL bFound = FALSE;
IEnumPins *pEnum;
IPin *pPin;
HRESULT hr =S_OK;
UCHAR localPinCounter = 0;
hr = pFilter->EnumPins(&pEnum);
if (SUCCEEDED(hr)) {
while(pEnum->Next(1, &pPin, 0) == S_OK) {
PIN_DIRECTION PinDirThis;
pPin->QueryDirection(&PinDirThis);
if (bFound = ( (PinDir == PinDirThis) && (PinCounter == localPinCounter) ) )
break;
pPin->Release();
localPinCounter++;
}
pEnum->Release();
} else {
return 0;
}
Regards,
sdancer75
|
|
|
|
|
hi
hi can u please help me to convert string in Unicode bytes,
I do this like this:
CString Hex(long val)
{
CString Buf=_T("");
Buf.Format(_T("%X"),val);
return Buf;
}
int Asc(const CString &cs)
{
unsigned char ch= cs[0];
return ch;
}
int AscW(const CString &cs)
{
CString g=_T("");
int ch = cs[0];
g.Format(_T("%d"),ch);
return _ttoi(g);
}
CString EncodeUserData_16_bit(CString strUserData)
{
CString EncodeUserData_16_bit;
int I=0;
CString hex_string=_T("");
for( I = 0; I<strUserData.GetLength();I++)
{
hex_string=_T("");
CString c=strUserData.Mid(I + 1-1, 1);
int ch=Asc(c);
CString g=_T("");
g.Format(_T("%d"),ch);
ch=AscW(c);
g.Format(_T("%d"),ch);
hex_string=Hex(AscW(c));
if(hex_string.GetLength()<4)
{
hex_string=PadZero(hex_string,4);
}
EncodeUserData_16_bit=EncodeUserData_16_bit+hex_string;
}
return EncodeUserData_16_bit;
}
its convert the string in Unicode bytes only one problem is that
if I convert "hello" to Unicode its return "00680065006C006C006F" but this result mismatch at the end of process.
if in place of "00680065006C006C006F" the value is "680065006c006c006f00" the process successfully finish.
if u please guide me anyhow of help me to solve this, its so grateful to u.
thanks in advance.
|
|
|
|
|
Try something like ...
CString EncodeUserData_16_bit(CString strUserData)
{
CString strEncoded;
for(int i = 0; i < strUserData.GetLength(); ++i)
{
CString unext;
unsigned int chnext = strUserData[i];
unext.Format(_T("%.4X"), chnext);
strEncoded += unext;
}
return strEncoded;
}
Veni, vidi, abiit domum
|
|
|
|
|
this return same vale as my function...
|
|
|
|
|
Well it works fine for me. Maybe you should explain why you think the result is not correct.
Veni, vidi, abiit domum
|
|
|
|
|
Does anybody know how to program a pic micro in C to detect gradient. I have set up ADC pins and each LDR is detecting light. Just need to set that a specific gradient of light detected by LDR will switch a light on.
|
|
|
|
|
Quote: gradient
Do you mean "range of frequencies" (or "range of wavelengths")?
Programming the PIC is relatively simple, I believe. You have first to:
- Be sure your light detector is sensitive to such frequency range.
- Filter in the light of such frequency range.
Once such conditions are satisfied you'll get a high value on the ADC measure when the 'gradient of light' is detected.
Veni, vidi, vici.
|
|
|
|
|
I am new to programming especially with pics. I am measuring the voltage reading from each LDR. It looks like a capacitor charging/discharging. I have an idea of what I have to do detect min and max values calculating the gradient etc. its just actually putting it in code.
|
|
|
|
|
Senned wrote: I have an idea of what I have to do detect min and max values calculating the gradient etc Please provide an example.
BTW what PIC family are you using?
Veni, vidi, vici.
|
|
|
|
|
for instance if the LDR is measuring 5V when it is dark and decreases to 0V this is in an ideal world. My pic is constantly scanning so I will probably need 3 variables each for min and max, so previous min, current min and main min, previous max, current max and main max. Now it will store a value for the previous value then take a new reading, if the current min is less than the prev. min then it would replace it as the main min. same goes for max if current max is greater than prev max then it would replace it as the main max value. Now that I have these I have values to calculate my gradient and determine whether or not it is detecting light from a certain light source or just background light. I am using pic24F16KL402.
|
|
|
|
|
Since you can write your application using C , it shouldn't be difficult to implement such logic. Or have you troubles in dealing with the ADC?
Veni, vidi, vici.
|
|
|
|
|
Yeah that has proved to be a problem when I tried it. The pic has only 2 buffers and I have usually had to work with more in the past (assign 1 LDR per buffer). Do you have any idea how to assign more than 1 LDR per buffer? I could send you my code if you like
|
|
|
|
|
Quote: Do you have any idea how to assign more than 1 LDR per buffer?
That is not a problem, actually. Just perform the process sequentially on the LDRs e.g.
- Sample and convert LDR1, take the result from
ADC1BUF0 , store it in variable, say ldr1 . - Sample and convert LDR2, take the result from the same buffer
ADC1BUF0 , store it in the variable ldr2 . - ...
Veni, vidi, vici.
|
|
|
|
|
Does anybody know how to program a pic micro to detect gradient. I have set up ADC pins and each LDR is detecting light. Just need to set that a specific gradient of light detected by LDR will switch a light on.
|
|
|
|
|
How do I read the file index.dat written. By dcmqrscp application how is the file record format.
Is any example available for reading it and Get the name of file moved ?
Thanks
Andrea
|
|
|
|
|
|
Thanks for hint.
I had a look to the links
But stil is not clear how to read index.dat to Get the name of the files retrieved. Do you know where i can Get some example?
Andrea
|
|
|
|
|
Member 10174363 wrote: Do you know where i can Get some example? Google is the only place for questions like this. I have had another look but could not find anything that may be relevant. I would suggest you try http://medical.nema.org/dicom/[^].
Veni, vidi, abiit domum
|
|
|
|
|
I understand Visual Studio 2012 and 2013 are using Microsoft Foundation Classes version 11. But only in the more professional versions like Ultimate.
Is it truth that Microsoft is still using MFC for its own products such as Office?
What to conclude from the fact that sources based on MFC 6 still build without any errors in VS2012? What other libraries or templates can offer the same?
Many people are feeling unsecure for making a choice for a library to work with. After some years same questions appear again.
Using an other library makes sources completely unrecognizable for other users.
Is it still wise using MFC? Is it easy to make connections to code based on STL? Is it a wise choice when you want to make managed code when possible? In other words can it be nicely coupled to .NET code?
I tried to find a consistent policy at MSDN. More and more people within Microsoft didn't ever hear about MFC.
To find out what's the latest version took me some research.
http://msdn.microsoft.com/en-us/library/d06h2x6e.aspx[^]
modified 16-Jan-14 19:30pm.
|
|
|
|
|
Is it still wise? ...sure, why not? You're always going to have some amount of risk when using a framework, but given the alternative of developing everything from scratch, the benefits outweigh the risks.
Considering MFC is essentially a class based wrapper around the WinAPI (with a lot of helper classes), I doubt it's going to disappear any time soon. It has a long history and I just don't see it ending soon. As far as what versions of VisualStudio have MFC, it's usually the Professional versions (and up). That's probably because they're using part of the cost of those versions to fund the maintenance of the libraries. Usually every version of VisualStudio also comes with a new version of MFC (although not sure if that's always been the case).
If you have a completely new project... you could always opt for C# and the .net framework, or Java and JRE, but if you already have quite a bit of experience with MFC versus the alternatives, it's probably safe to stick with that for the time being.
|
|
|
|
|
You can easily find free or commercial alternatives to the MFC, you don't need to handcode it yourself at all. That is not a valid reason to justify using the MFC.
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)
|
|
|
|