Error rc2108 expected numerical dialog constant

MFC Picture Control (error rc2108: expected numerical dialog constant) Visual C++ Решение и ответ на вопрос 1417255

0 / 0 / 0

Регистрация: 25.03.2015

Сообщений: 5

1

09.04.2015, 19:33. Показов 4196. Ответов 11


Когда меняю в picture control — тип с фрейма на Точечный рисунок, при запуске выводит ошибку error rc2108 expected numerical dialog constant.
При том, что я даже ничего не делал кроме этого =С
Помогите пожалуйста.

__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь



0



902 / 423 / 159

Регистрация: 02.04.2014

Сообщений: 1,206

09.04.2015, 20:46

2

А если обратно меняешь на «Frame», то всё опять работает?

MSDN говорит, что RC2108 это:

unbalanced parentheses
An open parenthesis was not matched with a closing parenthesis.

Наверное .rc файл каким то образом подредактировал и попортил. Попробуй удалить из ресурсов диалог и добавить его заново. Если не поможет, удалить весь файл .rc и снова добавить нужные ресурсы через меню Project->Add Resource… Если и это не поможет, то вероятно придётся создавать мастером новый проект.



0



0 / 0 / 0

Регистрация: 25.03.2015

Сообщений: 5

10.04.2015, 00:27

 [ТС]

3

В этом то и дело, что я создаю полностью чистую программу и пытаюсь поменять тип picture control, а оно выдает ошибку, то есть я ничего там не менял.

А если обратно меняешь на «Frame», то всё опять работает? именно так.



0



Людвиг Бодмер

374 / 371 / 213

Регистрация: 29.03.2013

Сообщений: 867

10.04.2015, 09:24

4

Rus9, студия 2013-ая ?
Вот здесь пишут вроде про этот баг: https://social.msdn.microsoft…. =vcgeneral
Надо добавить «Static», SS_BITMAP к коду в .RC файле, т.е. заменить

C++
1
CONTROL         IDB_BITMAP1,IDC_STATIC,2,2,89,82,NOT WS_GROUP

на

C++
1
CONTROL         IDB_BITMAP1, IDC_STATIC, "Static", SS_BITMAP, 2, 2, 89, 82, NOT WS_GROUP



2



0 / 0 / 0

Регистрация: 25.03.2015

Сообщений: 5

10.04.2015, 14:44

 [ТС]

5

Не помогает, а какую студию лучше установить?



0



-=ЮрА=-

Заблокирован

Автор FAQ

14.04.2015, 19:20

6

Rus9, обычно такая муть выскакивает когда кодер взял rc-шник из другого проекта, вставил в свой а ID битмапы которая шла в PictureControl есно не поменял, в итоге при линковке имеем «левый» ID и как следствие посыл от линковщика.



0



0 / 0 / 0

Регистрация: 25.03.2015

Сообщений: 5

15.04.2015, 16:55

 [ТС]

7

Дело в том что, это новый проект и я в него ничего не добавлял и не удалял, и в любом случае вылетает ошибка



0



-=ЮрА=-

Заблокирован

Автор FAQ

15.04.2015, 21:09

8

Rus9, возможно дело в среде разработки, в чём разрабатываешь?



0



0 / 0 / 0

Регистрация: 25.03.2015

Сообщений: 5

17.04.2015, 20:45

 [ТС]

9

вс 13

Добавлено через 23 часа 10 минут
-=ЮрА=-, А какую версию ВС вы посоветуете?
что б не было никаких лишних ошибок…



0



-=ЮрА=-

18.04.2015, 08:34

Не по теме:

Rus9, 2008 (9-ую) или 2010 (10-ую), обе версии должны ставится с сервис паком 1. По поводу студии — не рекомендую версии с момента релиза которых не прошло три года(обычно за этот срок разработчики выявляют и устраняют большинство недочётов версии)



0



0 / 0 / 0

Регистрация: 05.02.2015

Сообщений: 18

27.06.2015, 13:49

11

Установи 4 обновление для Visual Studio 2013 там этот баг профиксен все будет нормально работать



0



0 / 0 / 0

Регистрация: 26.02.2017

Сообщений: 17

26.02.2017, 11:28

12

Такая же проблема

Добавлено через 5 минут
Людвиг Бодмер, я пробовал ставить «static», но тогда изображение просто напросто пропадает
SS_BITMAP спасает! Спасибо Людвигу, вроде всё работает



0



Содержание

  1. Error rc2108 expected numerical dialog constant
  2. Answered by:
  3. Question
  4. Answers
  5. All replies
  6. Error rc2108 expected numerical dialog constant
  7. Answered by:
  8. Question
  9. Answers
  10. All replies
  11. Error rc2108 expected numerical dialog constant
  12. Answered by:
  13. Question
  14. Answers
  15. All replies
  16. Error rc2108 expected numerical dialog constant
  17. Answered by:
  18. Question
  19. Error rc2108 expected numerical dialog constant
  20. Answered by:
  21. Question
  22. Answers
  23. All replies

Error rc2108 expected numerical dialog constant

This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.

Answered by:

Question

We have just migrated a MFC/CLR VS2008 solution to VS2013. Modifying a resource in VS2013, i.e. Version information, breaks the .rc file causing the above error when compiling.

Here’s a snippet of the resource file after migration in it’s working state.

After modifying resources using the VS2013 IDE, it is broken.

This has stopped us in our tracks. Is there a pre-release patch to fix this issue?

Thanks in advance.

Answers

This *is* a real pain. You can work around it sort of by using a running copy of VS 2012 to edit the resource file and just switching back and forth between the VS 2013 and VS 2012 sessions when you want to change resources, but unless you really need something in VS 2013 this seems kind of ridiculous. I’ve been doing this:

1. Open solution in VS 2013

2. Open resource file in VS 2012

3. Modify resource in VS 2012 window and click save button

4. Recompile in VS 2013 window

At least I can keep working this way and enjoy the new debugging benefits of VS 2013.

I wrote a little awk script (actually gawk, GNU awk) to handle this. It only works for SS_BITMAP controls (specifically not SS_ICON and probably SS_ENHMETAFILE) but SS_BITMAP is all I use. I invoke this script from a batch file in the pre-build event and it has the sense to leave the .RC file alone if no changes are required, thus avoiding unnecessary recompiles and links. OK, here’s the script (fix_rc.awk):

And here’s the batch file (patch in .rc filename to suit):

Источник

Error rc2108 expected numerical dialog constant

This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.

Answered by:

Question

All I did was copy a .rc file from VS2010 into VS2013 and remove 1 string constant.

VS2013 has cleverly substituted the numerical constant in field 1 of all my bitmap controls :-

for its equivalent Label value in resource.h (IDB_30MPH) plus a few other changes to get :-

CONTROL IDB_30MPH,IDC_STATIC,65,42,46,43,NOT WS_GROUP

The compiler now gives the error :-

RC2108 expected numerical dialog constant

There is a #include at the top of the .rc file

I am using the release version of VS2013 and can easily edit the .rc file BUT SOMETHING IS NOT QUITE RIGHT IN THE RESOURCE EDITOR/COMPILER

Answers

I’ve just seen this problem on another forum and after trial & error have come up with this frig:-

Delete bitmap from dialog

Drag MFC Button Control to its location

In Properties change:

Image Type = Bitmap

Image On Top = True

Image = IDB_. (your bitmap ID)

Style = No Borders

Tab Stop = False

Resize control to show all of bitmap

It works for me — but I’ve only got 3 bitmaps to do

  • Marked as answer by Jack Zhai-MSFT Microsoft contingent staff Tuesday, December 3, 2013 5:26 AM

This problem still occurs if I substitute 472 for IDB_30MPH

More to the point, it occurs if I create the dialog from scratch & add a bitmap picture control.

I’ve just seen this problem on another forum and after trial & error have come up with this frig:-

Delete bitmap from dialog

Drag MFC Button Control to its location

In Properties change:

Image Type = Bitmap

Image On Top = True

Image = IDB_. (your bitmap ID)

Style = No Borders

Tab Stop = False

Resize control to show all of bitmap

It works for me — but I’ve only got 3 bitmaps to do

  • Marked as answer by Jack Zhai-MSFT Microsoft contingent staff Tuesday, December 3, 2013 5:26 AM

Thank you for sharing your solutions here. It will be very beneficial for other community members who have similar questions.

In addition, based on this thread, since this issue has been submitted to the connect report, you could also vote it/post your latest information here:

You will get email notification for update . Thanks for your understanding.

We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.

It is not just bit maps — it is lots of resources.

After compiling my VS2010 project in VS2013 ultimate, I have 12 of these errors. Some of the dialogs that it complains about do not even have bit maps.

The error is assigned to the «END» statement for three dialogs

The error is assigned to a CONTROL line four times

The error is assigned to a CTEXT line five times

When I do a text comparison between the VS2010 file and the VS2013 file, I see that some of the error lines have been modified in strange ways by VS2013.

The error is assigned to a CTEXT line

I can confirm those problems.

My team encounters this repeatedly.

We have a sizable legacy application that has been migrated across several versions of Visual Studio over the years. Nearly every time we make an edit in Resource Editor in Visual Studio, it clobbers all the old bitmap definitions (at least). [It may be clobbering more than that, but the bitmaps are the main problem and the only thing we’ve confirmed gets consistently wrecked.]

Manually replacing all the problem controls by dragging in a new MFC button control is NOT a reasonable option for us. The application is very large and the RC file is over 22,000 lines long. If forced to use a workaround, we could possibly write a quick one-off script to change the problem lines to a different format, IF we knew what format to use.

Wouldn’t it be better to fix the Resource Editor?

It seems like it is a brittle component in the Microsoft tool stack, and maybe doesn’t receive the attention it deserves?

Источник

Error rc2108 expected numerical dialog constant

This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.

Answered by:

Question

We have just migrated a MFC/CLR VS2008 solution to VS2013. Modifying a resource in VS2013, i.e. Version information, breaks the .rc file causing the above error when compiling.

Here’s a snippet of the resource file after migration in it’s working state.

After modifying resources using the VS2013 IDE, it is broken.

This has stopped us in our tracks. Is there a pre-release patch to fix this issue?

Thanks in advance.

Answers

This *is* a real pain. You can work around it sort of by using a running copy of VS 2012 to edit the resource file and just switching back and forth between the VS 2013 and VS 2012 sessions when you want to change resources, but unless you really need something in VS 2013 this seems kind of ridiculous. I’ve been doing this:

1. Open solution in VS 2013

2. Open resource file in VS 2012

3. Modify resource in VS 2012 window and click save button

4. Recompile in VS 2013 window

At least I can keep working this way and enjoy the new debugging benefits of VS 2013.

I wrote a little awk script (actually gawk, GNU awk) to handle this. It only works for SS_BITMAP controls (specifically not SS_ICON and probably SS_ENHMETAFILE) but SS_BITMAP is all I use. I invoke this script from a batch file in the pre-build event and it has the sense to leave the .RC file alone if no changes are required, thus avoiding unnecessary recompiles and links. OK, here’s the script (fix_rc.awk):

And here’s the batch file (patch in .rc filename to suit):

Источник

Error rc2108 expected numerical dialog constant

This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.

Answered by:

Question

Hi, I have a vs2013 c++ project which I migrated from vs2012. The only unresolved issue I have is in displaying a BITMAP Picture Control on a dialog box — which worked perfectly on vs2012.

When I insert a Picture Control into the dialog box and associate a BITMAP to it (via Resource View), the image displays properly in Resource View. However, upon compiling, i get the following error:

error RC2108: expected numerical dialog constant

The code in my .RC file is:

The above code gives me the error. If i however remove:

.. then it compiles fine, but obviously without a BITMAP displaying.

Everything is properly defined in my resource.h file.

Would anyone know what the issue is with vs2013? Any help most appreciated.

Источник

Error rc2108 expected numerical dialog constant

This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.

Answered by:

Question

We have just migrated a MFC/CLR VS2008 solution to VS2013. Modifying a resource in VS2013, i.e. Version information, breaks the .rc file causing the above error when compiling.

Here’s a snippet of the resource file after migration in it’s working state.

After modifying resources using the VS2013 IDE, it is broken.

This has stopped us in our tracks. Is there a pre-release patch to fix this issue?

Thanks in advance.

Answers

This *is* a real pain. You can work around it sort of by using a running copy of VS 2012 to edit the resource file and just switching back and forth between the VS 2013 and VS 2012 sessions when you want to change resources, but unless you really need something in VS 2013 this seems kind of ridiculous. I’ve been doing this:

1. Open solution in VS 2013

2. Open resource file in VS 2012

3. Modify resource in VS 2012 window and click save button

4. Recompile in VS 2013 window

At least I can keep working this way and enjoy the new debugging benefits of VS 2013.

I wrote a little awk script (actually gawk, GNU awk) to handle this. It only works for SS_BITMAP controls (specifically not SS_ICON and probably SS_ENHMETAFILE) but SS_BITMAP is all I use. I invoke this script from a batch file in the pre-build event and it has the sense to leave the .RC file alone if no changes are required, thus avoiding unnecessary recompiles and links. OK, here’s the script (fix_rc.awk):

And here’s the batch file (patch in .rc filename to suit):

Источник

I’m working with VS2005 to target WinCE device, currently building MFC GUI. I’m getting an error related to row

CTEXT IDC_PG,168,183,63,63

saying

my_app.rc(95) : error RC2108 : expected numerical dialog constant

I’m convinced that CTEXT line is problematic (error is pointing at line after this one. I have moved CTEX line from middle of the block to the end, I was getting error for line after CTEXT also when it was n the mid) but I have no idea what might be incorrect here.

This is full block of code:

BEGIN
   LTEXT           "Static",IDC_SEL,337,122,63,61,SS_NOTIFY
   LTEXT           "Static",IDC_ESC,337,183,62,63,SS_NOTIFY
   LTEXT           "Static",IDC_RETURN,337,122,63,123,SS_NOTIFY
   LTEXT           "Static",IDC_RB,337,45,63,61,SS_NOTIFY
   LTEXT           "Static",IDC_LB,337,0,63,61,SS_NOTIFY
   LTEXT           "Static",IDC_DN,337,61,63,61,SS_NOTIFY
   LTEXT           "Static",IDC_UP,337,0,63,61,SS_NOTIFY
   LTEXT           "Static",IDC_SET,274,183,63,63,SS_NOTIFY
   LTEXT           "Static",IDC_VYPLN,0,183,211,63,SS_NOTIFY
   LISTBOX         IDC_LF,1,1,338,182,LBS_NOINTEGRALHEIGHT | NOT WS_BORDER | WS_TABSTOP
   CTEXT           "Static",IDC_PHOTO,0,0,337,245
   CTEXT           "Static",IDC_BG,0,0,400,245
   LTEXT           "Static",IDC_ESC2,202,182,62,63,SS_NOTIFY
   CTEXT           IDC_PG,168,183,63,63    //PagingWidget
END

Thanks in advance for shedding some light on this.


Your explained your problem in this one sentence: «I dont want to make it «Static» as im planning to use that widget to show currentPage»

The compiled resources in your project that is resource.h, and all *.rc and *rc2 files can contain only static data that is linked with you application. All resource items must have an ID (a UINT as seen from your application code but a STRING for the OS) that is constant and defined at compile time.

If you need to create controls dynamically, you must do so in the code. You can manage them by having them as members of your dialog class, or in dynamic memory in a vector of pointers (CWnd’s cannot be copied). MFC provides CObArray which provides some basic RAII for dynamically allocated CWnd*.

If you really feel the need to have to reference rectangles on your dialog to place your dynamic controls, insert some dummy, invisible static controls on the dialog with the editor.

Alternatively, if you know already the maximum number of widgets you’ll need, place them as static items on the dialog resource, and show /hide items in the OnInitDialog() member function for your dialog.

Sorry, for bringing you the bad news… I hope you have a good backup.

Когда мы используем графический элемент управления Picture Control для добавления изображений в диалоговое окно, ошибка RC2108: часто появляется ожидаемая числовая постоянная диалогового окна


Решение:

Дважды щелкните по ошибке rc2018 …, чтобы открыть файл


Добавьте «Static», SS_BITMAP в позицию, как показано

Трансфер из:https://blog.csdn.net/renyhui/article/details/23120469


Интеллектуальная рекомендация

указатель-события: нет; решить проблему сбоя клика

На работе сделал выпадающий список. Фон стрелки вниз добавляется к form-select :: after, но при нажатии стрелки событие раскрывающегося списка не может быть запущено. Так что добавьтеpointer-events: n…

Как идея соединяет MySQL?

1. Открытая идея 2. Справа есть база данных, щелкните 3. Нажмите » +» 4. Продолжайте нажимать 5. Выберите MySQL 6. Введите, где находится база данных, имя пользователя, пароль, тестовое соед…

CSRF и SSRF

Введение в уязвимости CSRF CSRF (подделка межсайтовых запросов, подделка межсайтовых запросов) относится к использованию недействительной идентификационной информации жертвы (файлы cookie, сеансы и т….

Разработка управления приложениями

Получить всю информацию о приложении PackageManager Android управляет пакетами приложений через PackageManager, и мы можем использовать его для получения информации о приложениях на текущем устройстве…

Вам также может понравиться

Анализ исходного кода пула потоков -jdk1.8

openjdk адрес загрузки http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/tags Логические шаги пула потоков, с которыми поставляется Java, — это, в основном, следующие шаги: Реализация псевдокода Отправить ис…

Используйте инструменты в макете XML:

В макете, если некоторые фиксированные значения атрибута не установлены, некоторое представление не будет видно, когда будет видна макет. Все, что мы можем увидеть эффект предварительного просмотра, к…

Войдите в JVM

1. Введение в JVM 1.1 Концепция JVM Введение в виртуальную машину: JVM (аббревиатура от Java Virtual Machine. Java Virtual Machine.), JVM — это настраиваемый компьютер, которого на самом деле не сущес…

пользователи Linux и группы пользователей

Пользователь категория Профиль пользователь Root (Root пользователя) Команда Советы Упорядочить #, имеет самую высокую задачу разрешения любого разрешения файла недействительно для корневого пользоват…

Котлин Базовый — класс и атрибуты

Давайте напишем простой JavaBean класса Student в Java, только с одним свойством, имя. Тот же класс в Котлин это: PUBLIC в Котлин является видимость по умолчанию, поэтому его можно опустить. Этот вид …

Понравилась статья? Поделить с друзьями:
  • Error rate statistics
  • Error rate performance
  • Error rate none
  • Error rate limit exceeded awakened poe trade
  • Error rate formula